-
Type: Task
-
Resolution: Done
-
Priority: Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: None
-
Empty show more show less
-
Not Needed
NODE-4009 Description
What problem are you facing?
We are developing a serverless application build on AWS Lambda. After upgrading driver to 4.x major version we have notice that only a few of about hundred of lambdas are failing because of
Cursor session id (xxx) is not the same as the operation context's session id (none)
We are initializing db connection outside of lambda handler as suggested here:
https://docs.atlas.mongodb.com/best-practices-connecting-from-aws-lambda/
The error occurs only on subsequent queries on the cached connection. What's more, we were observing it only in functions that do "heavy" queries, fetched lot of data from db.
What driver and relevant dependency versions are you using?
mongodb: 4.3.1
Steps to reproduce?
I was not able to reproduce it outside of lambda environment, however I've prepare a simple reproduction repository with one lambda function. If you follow the steps from README and deploy it to your AWS account, you will see errors in Cloud Watch logs quickly.
https://github.com/dimitor115/mognodb-node-driver-cursor-error-reproduction
I'm also attaching a logs from this reproduction lambda, where you can see the errors, logs also contains driver debug output.
- is depended on by
-
NODE-4009 Some request on cached connection causes cursor session error in serverless enviroment
- Closed