Skip to content

Commit 0a54175

Browse files
committed
Note that RS clients are invalid after a fork.
1 parent 208aa7f commit 0a54175

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pymongo/mongo_replica_set_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
514514
sure you call :meth:`~close` to ensure that the monitor task is
515515
cleanly shut down.
516516
517+
.. note:: A :class:`MongoReplicaSetClient` created before a call to
518+
``os.fork()`` is invalid after the fork. Applications should either
519+
fork before creating the client, or recreate the client after a
520+
fork.
521+
517522
:Parameters:
518523
- `hosts_or_uri` (optional): A MongoDB URI or string of `host:port`
519524
pairs. If a host is an IPv6 literal it must be enclosed in '[' and

0 commit comments

Comments
 (0)