-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.8.1, 1.8.2
-
Component/s: None
-
None
Due to a logic bug introduced into PoolManager#refresh, it was creating a new socket pool unnecessarily and failing to clean up any open sockets under certain conditions.
In a multi-threaded environment, this was causing new socket pools to be opened up constantly and connections counts to skyrocket well past the specified max pool size.
The issue was introduced here:
https://github.com/mongodb/mongo-ruby-driver/commit/92e862bf1e57398b4ecb4f0f0e56b0d560e73901#L1L54
A test case for reproducing the issue is attached.