[CSHARP-3431] Make MongoClient IDisposable to allow short lifetime scope usage Created: 18/Feb/21  Updated: 15/Jan/24

Status: Scheduled
Project: C# Driver
Component/s: Configuration
Affects Version/s: None
Fix Version/s: 3.0.0

Type: New Feature Priority: Major - P3
Reporter: Mikalai Mazurenka (Inactive) Assignee: Boris Dogadov
Resolution: Unresolved Votes: 3
Labels: size-xlarge
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-4512 Update CMAP logging tests to include ... Backlog
Duplicate
is duplicated by CSHARP-4513 Problem with MonitorServer heartbeat ... Closed
Related
is related to DRIVERS-2547 Caching mongoclient connection Defining Requirements
is related to CSHARP-3424 Using temporary credentials require r... Closed
Epic Link: Implement 3.0 release
Quarter: FY24Q4
Case:
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

According to existing implementation the general advice on MongoClient usage is singleton lifetime scope.

Lately several small issues (e.g. CSHARP-3424) arose which require per-instance use of MongoClient. This lifetime scope will result in excessive memory usage and undisposed resources.

These small issues could be mitigated by making MongoClient IDisposable and changing the design accordingly to allow usage with short lifetime scope.


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