-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.1.4
-
Component/s: None
-
None
What problem are you facing?
When connected to serverless and running a find query for multiple databases in parallel while passing the same session to all requests driver fails with an error:
TypeError: Cannot pin multiple connections to the same session at ClientSession.pin (/Users/sergey.petushkov/Projects/MongoDB/compass2/node_modules/mongodb/lib/sessions.js:114:19)
What driver and relevant dependency versions are you using?
Node.js Driver v4.1.4
MongoDB 5.1.0 Enterprise Serverless (Load Balanced)
Steps to reproduce?
Assuming sample data exists on the server:
var client = new MongoClient('<connection string>') await client.connect(); var session = client.startSession(); await Promise.all([ client .db("sample_airbnb") .collection("listingsAndReviews") .find({}, { session }) .limit(20) .toArray(), client .db("sample_mflix") .collection("movies") .find({}, { session }) .limit(20) .toArray(), ]);
Note that the issue appears to happen only when connected to serverless and doesn't reproduce when running commands in parallel against the same database
- related to
-
COMPASS-5299 1.29.4 (stable) ver. Stuck in a "Fetching Documents" Loop for Serverless
- Closed