-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
Noticed this bug when working on PYTHON-2395 where MongoClient can create more than minPoolSize background connections.
active_sockets is the count of checked out connections. As part of clearing the connection pool, pool.reset() resets the "active_sockets" count to 0. However, if we reset the count to 0 when a connection is checked out then active_sockets will become negative when the connection is eventually checked back in. For example (pseudocode):
conn = pool.checkout() # active_sockets == 1 pool.clear() # active_sockets == 0 pool.checkin(conn) # active_sockets == -1
Luckily the only thing active_sockets is used for is maintaining minPoolSize connections. So the only side effect of this bug is that the client might create more than minPoolSize connections.
- is duplicated by
-
PYTHON-2637 Client attempts to create background connections even with minPoolSize=0
- Closed
- related to
-
PYTHON-2395 Consider server load during server selection
- Closed