[CSHARP-2105] Move server session pool from MongoClient to Cluster Created: 20/Nov/17  Updated: 28/Oct/23  Resolved: 28/Dec/17

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: 2.7.0

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The initial implementation of sessions has the server session pool associated with a MongoClient instance.

While this is perfectly logical, some applications create a new MongoClient instance for every operation (we don't recommend this but don't prohibit it).

If an application does open a new MongoClient instance for every operation, the result will be that a new server session is started for every operation. The server is never told that this server session is no longer needed so the server will end up with lots of unused sessions that won't get cleaned up until 30 minutes go by.

We should support this scenario more efficiently by implementing the server session pool at a lower level such that a server session pool can be shared by multiple MongoClient instances.



 Comments   
Comment by Githook User [ 28/Dec/17 ]

Author:

{'username': 'rstam', 'email': 'robert@robertstam.org', 'name': 'rstam'}

Message: CSHARP-2105: Move server session pool from MongoClient to Cluster
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/d72beef3aaec39ea951f7666045c36b6bda56b68

Generated at Wed Feb 07 21:41:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.