Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1272

Potential deadlock in an exhaust Cursor destructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.12, 4.0
    • 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

          Activity

            People

              shane.harvey@mongodb.com Shane Harvey
              shane.harvey@mongodb.com Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: