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.
(I did install gevent to see if the issue was present under gevent and it was)