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

Suppress multiprocessing warning

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 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.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            rotten Rick Otten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: