mongo-csharp-driver icon indicating copy to clipboard operation
mongo-csharp-driver copied to clipboard

CSHARP-2423 Fixed Connection Pools lock contention

Open valentin-abalmasov opened this issue 7 years ago • 2 comments

Locks changed to lock-free containers in order to get rid of lock contention in "threads heavy" environments. JIRA issue The main problem in existing code that all releases (Dispose) of connections inside pools was made inside lock. It is possible to rewrite existing code and move Dispose outside of the lock, but lock-free containers are far more effective that current solution

valentin-abalmasov avatar Dec 02 '18 11:12 valentin-abalmasov

@valentin-abalmasov did you found a solution for you lock contention issue, We have the same issue with MongoDb.Driver 2.18.0 ? I see that related jira ticket is closed

medboz avatar Nov 17 '23 11:11 medboz

@valentin-abalmasov did you found a solution for you lock contention issue, We have the same issue with MongoDb.Driver 2.18.0 ? I see that related jira ticket is closed

@medboz Unfortunately our fix was not accepted as merge request, but, we do apply the changes from merge request to our own fork of driver, because we still experience "lock contention" issue in our software

valentin-abalmasov avatar Feb 09 '24 11:02 valentin-abalmasov

Thanks for your PR @valentin-abalmasov. ConnectionPool synchronization behavior and event order is largely dictated by our specs, and this can be a breaking change in some scenarios. gRPC will replace our existing connection pooling logic. How we integrate this with our current networking code is uncertain at the moment as we will have to maintain both the mongorpc and gRPC stacks in our drivers for many years. That said, I don't think we will get around to reworking the connection pool locking code before the gRPC work and we can close this as "won't do".

BorisDog avatar Jun 14 '24 18:06 BorisDog