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

Pinned connections are sometimes returned to the pool twice

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.12, 4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      PYTHON-2677 refactored the Pool to remove the "checkout" argument in favor of the new SocketInfo.pin_txn/pin_cursor() methods. However the new logic has a bug. When the operation completes successfully and unpins the connection at the same time, the connection will be returned to the pool twice. Once by the operation itself and once again when exiting pool.get_socket.

      An example is when a cursor returns the entire result in the first batch. Both the Cursor and pool.get_socket return the connection to the pool.

            shane.harvey@mongodb.com Shane Harvey
            shane.harvey@mongodb.com Shane Harvey
            0 Vote for this issue
            1 Start watching this issue