ExportXMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      MongoClient.close() closes its sockets and signals its background threads to exit but it does not actually wait for the threads to exit (via join). This is problematic when using a MongoClient from a subinterpreter. Even when closing the MongoClient, an error gets raised when closing the subinterpreter: Py_EndInterpreter: not the last thread

      Reported in: https://groups.google.com/d/msg/mongodb-user/vgsE6MpcyGE/1xm-WXMrAAAJ
      and: https://groups.google.com/forum/#!topic/jep-project/lAv7-HVAnv8

      Things to consider:

      • Is the lack of a join() intentional?
      • Don't hold the topology lock when attempting a join because the thread can be waiting for the same lock.
      • PeriodicExecutor used to sleep for 100ms at a time to and check for a close but that was changed in PYTHON-983. Now PeriodicExecutors sleep for half a second at a time. Perhaps we should reintroduce the 100ms sleeps (without using condition variables on Python 2).
      • Should we add a timeout parameter to MongoClient.close?
      • Should we provide a MongoClient.join method with a timeout?

            Assignee:
            Unassigned
            Reporter:
            Shane Harvey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: