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

Suppress "MongoClient opened before fork." warning when disconnected

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Works as Designed
    • 3.1.1
    • None
    • None
    • Ubuntu 14.04.3, Python 2.7.6

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: