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

disconnect() doesn't unblock threads waiting on connection pool

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: 2.8, 3.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      A MongoClient calls disconnect() to reset its connection pool (and other state), whenever it loses its connection to MongoDB. MongoReplicaSetClient calls disconnect() to resets its connection pools for all replica set members. Users might also call disconnect() directly, on either client class.

      If threads are waiting for sockets from the connection pool(s) they must be unblocked by disconnect() so they can attempt to open new sockets. Currently they remain blocked on the max_pool_size semaphore. They'll be awakened the next time a socket is checked in.

      If the thread that calls disconnect(), then does an operation, it will open a new socket, check it in, and unblock the waiters. But if it doesn't, and all other threads are already blocked, the application deadlocks.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: