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

Suppress "MongoClient opened before fork." warning when disconnected

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.1.1
    • Component/s: None
    • Environment:
      Ubuntu 14.04.3, Python 2.7.6

      If you fork children from a parent process using the multiprocessing library you may get these warnings:

      /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>

      We only use MongoClient to set up data in the parent before forking and don't use it after forking. We even close the Connection before initiating the fork, however we still get those warnings.

      There should be some way to suppress them in a use case such as ours.

            Assignee:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Reporter:
            rotten Rick Otten
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: