-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
When creating a MongoClient with the connect=False option we should delay starting the pymongo_kill_cursors_thread. This is a minor improvement that reduces the number of threads for unused (connect=False) clients.
At first glance it might also seem like a good idea to always delay starting the pymongo_kill_cursors_thread until the first operation (first call to _get_topology()) however we should not go that far. This thread is responsible for more than just killing cursors, it also ensures that there are minPoolSize connections. Opening minPoolSize connections in the background is a good thing since it can reduce the latency of the first operation.
- duplicates
-
PYTHON-2285 Don't start kill cursors thread until MongoClient actually connects
- Closed
- related to
-
PYTHON-1704 MongoClient.close does not stop its "pymongo_kill_cursors_thread"
- Closed
-
PYTHON-2268 Close clients created in test suite
- Closed