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

PyMongo ReplicaSetConnection monitor hanging in test suite

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8, 3.0
    • Affects Version/s: 2.7.2
    • Component/s: None
    • Labels:
      None

      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)

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            keen_jay Jay Shirley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: