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

PyMongo ReplicaSetConnection monitor hanging in test suite

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.8, 3.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Python Sprint 9

      Description

      We are updating from a properly ancient (2.1.x) version of pymongo, and everything has worked fine after some modifications except for our test suite.

      We connect to mongo, with a replica set, via mongoengine:

      conn = connect(None, host=host_string, replicaSet=replica_set)

      The test suite is under nose, and all tests pass except it hangs indefinitely (I can kill -9 or stop mongo). Tracing this, the monitor.join() call never returns, blocking on the thread forever.

      I've put in a call to explicitly disconnect from Mongo before the script exits, and confirm that it is being executed.

      MongoEngine's disconnect is closing all open connections prior to monitor.shutdown() (triggered by the atexit event) being called.

      Our test suite is pretty large, and this is difficult to reduce down. I'm a novice when it comes to threaded python, but am happy to do what I can to test or change with some guidance.

      Thanks!

      (I did install gevent to see if the issue was present under gevent and it was)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: