Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
None
Description
Directly calling self.__exhaust_mgr.close() in Cursor.__del__ can lead to a deadlock. In jesse's words:
It'd require an exhaust cursor to be part of a circular reference that happens to be cleaned up by a GC run triggered while a thread is holding the pool's lock, thus it's so absurdly rare we've never seen it. Nevertheless, we should return an exhaust cursor's socket to the pool in MongoClient._process_periodic_tasks, not synchronously in Cursor.__del__.
Attachments
Issue Links
- causes
-
MOTOR-770 Test failure - test_exhaust
-
- Closed
-
- related to
-
PYTHON-799 Rare deadlock in Cursor destructor
-
- Closed
-
-
PYTHON-1636 Support Exhaust Cursor in OP_MSG
-
- Closed
-
-
PYTHON-2673 Connection pinning behavior for load balanced clusters
-
- Closed
-