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

Call endSessions

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6
    • Component/s: None
    • Labels:
      None

      Description

      In PYTHON-1332 I didn't implement the code to send "endSessions" when destroying a MongoClient. (The server side wasn't done yet.) This should be implemented, probably in Topology.close, which is called by MongoClient.close.

      Sending "endSessions" cannot be automatic: adding a destructor method to MongoClient and trying to send "endSessions" from there is too risky. We can't safely do network I/O in a method that could be called by the cyclic garbage collector, we risk a deadlock or other catastrophes.

      Let's document that in MongoDB 3.6, short-lived MongoClients should be closed at the end (but only the end!) of the program's life to avoid cluttering the server's sessions collection.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: