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

Don't mention "connect=False" in fork warning

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.6
    • Affects Version/s: None
    • Component/s: Docs
    • None

      Based on my conversation here:

      https://stackoverflow.com/questions/46441918/mongoclient-opened-before-fork-create-mongoclient/

      It seems like this warning still confuses people:

      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#pymongo-fork-safe>

      Users might think that passing connect=False makes a client fork-safe. In fact, if they pass connect=False and use the client in a way that triggers connection, and then fork, they still risk deadlock.

      The doc that the warning links to doesn't mention creating a MongoClient with connect=False.

      Let's try once again to help people understand how to use PyMongo in forking programs. We have a couple options:

      • Explain in the doc how to create a MongoClient with connect=False and warn users not to trigger auto-connection until after they fork
      • Leave the doc as-is and remove the warning's mention of connect=False

      Either way let's remove the ">" from the end of the warning message.

      (Thanks for the suggestion thiago.galesi@10gen.com.)

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: