• Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: