[DRIVERS-1030] Drivers should check out an implicit session only after checking out a connection Created: 07/Apr/20  Updated: 17/Nov/23  Resolved: 17/Nov/23

Status: Closed
Project: Drivers
Component/s: Sessions
Fix Version/s: None

Type: Spec Change Priority: Major - P3
Reporter: Esha Bhargava Assignee: Neal Beeken
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DRIVERS-2126 Drivers should check out an implicit ... Closed
Issue split
split to JAVA-4365 Check out an implicit session only af... Closed
split to RUST-1069 Drivers should check out an implicit ... Closed
split to CDRIVER-4197 Drivers should check out an implicit ... Closed
split to CSHARP-3927 Drivers should check out an implicit ... Closed
split to CXX-2398 Drivers should check out an implicit ... Closed
split to GODRIVER-2197 Drivers should check out an implicit ... Closed
split to MOTOR-841 Drivers should check out an implicit ... Closed
split to NODE-3697 Check out an implicit session only a... Closed
split to PHPLIB-747 Drivers should check out an implicit ... Closed
split to PYTHON-2956 Drivers should check out an implicit ... Closed
split to RUBY-2820 Check out an implicit session only af... Closed
Problem/Incident
causes DRIVERS-2398 Limit mongos Hosts for Implicit Sessi... Implementing
Related
related to JAVA-3856 Database connection error is not noti... Closed
related to DRIVERS-2126 Drivers should check out an implicit ... Closed
is related to DRIVERS-2218 Clarify intended bounding of implicit... Implementing
Driver Changes: Needed
Quarter: FY22Q4
Downstream Changes Summary:

Drivers need to implement a new prose test, and implement either a refactor of their sessions allocation to occur after connection checkout or lazily allocate an existing session after successful checkout.

Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4197 Works as Designed
CXX-2398 Works as Designed
CSHARP-3927 Done
GODRIVER-2197 Fixed 1.11.0
JAVA-4365 Fixed 4.5.0
NODE-3697 Fixed 4.5.0
PHPLIB-747 Won't Do
PYTHON-2956 Fixed 4.1
MOTOR-841 Duplicate
RUBY-2820 Fixed 2.18.0
RUST-1069 Fixed 2.5.0
SWIFT-1383 Fixed 1.3.0

 Description   

Problem:
When the number of concurrent application requests are larger than the number of available connections, the driver may generate many more implicit sessions than connections. For example with maxPoolSize=1 and 100 threads, 100 implicit sessions may be created. This increases the load on the server since session state is cached in memory. In the worst case this kind of workload can hit the session limit and trigger TooManyLogicalSessions.

Proposed solution:
Drivers should check out an implicit session only after checking out a connection. This change will limit the number of implicit sessions to no greater than an application's maxPoolSize (ignoring operations that hold on to the session like cursors).

This change would not have any effect on explicit sessions created with startSession.



 Comments   
Comment by Githook User [ 03/Feb/22 ]

Author:

{'name': 'Neal Beeken', 'email': 'neal.beeken@mongodb.com', 'username': 'nbbeeken'}

Message: DRIVERS-1030: Session allocation should occur after connection checkout - test improvements (#1134)
Branch: master
https://github.com/mongodb/specifications/commit/d426b9041704ca48aaebde403d8cb443e47247f7

Comment by Githook User [ 01/Feb/22 ]

Author:

{'name': 'Neal Beeken', 'email': 'neal.beeken@mongodb.com', 'username': 'nbbeeken'}

Message: DRIVERS-1030: Implicit sessions allocate underlying server session after connection checkout (#1125)
Branch: master
https://github.com/mongodb/specifications/commit/81b28917e2d58ff0cb3b70877e74695a80816a0c

Generated at Thu Feb 08 08:22:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.