mongodb/mongo-python-driver — pull request #190 by cxmcc (2013-07-04 11:44:28+00:00)
Title: Monitor threads can died unexpectedly with forks

Monitor thread will die if created before a double fork.

Developer should avoid creating MongoReplicaSetClient instance before forking, however there is no any warning about this behavior.
But I think nothing we can do but throw an exception as warning, this might help saving time trouble shooting.

This happened to my system. Monitor thread died and refresh() was never called when a failover happens.
And as a result, error message will stay as "No replica set primary available for query with ReadPreference PRIMARY", even after failover is completed, which is confusing. Hope this change/idea will be a bit more helpful in such cases.