-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.1.1
-
Component/s: None
-
Environment:Ubuntu 14.04.3 with Python 2.7.6.
If you use MongoClient in a parent process before forking children using the python multiprocessing library you'll get a warning like this:
/usr/local/lib/python2.7/dist-packages/pymongo/topology.py:74: UserWarning: MongoClient opened before fork. Create MongoClient with connect=False, or create client after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#using-pymongo-with-multiprocessing>
In our use case we use MongoClient to run some queries to set up the future child processes and then we close the connection before we fork. We never use MongoClient in the children.
We still get this warning. It would be nice to be able to suppress it somehow.