Skip to content

Commit 9969677

Browse files
committed
Stronger warning about MRSC.close() PYTHON-511
1 parent bc046e5 commit 9969677

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pymongo/mongo_replica_set_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,12 @@ def close(self):
10031003
"""Close this client instance.
10041004
10051005
This method first terminates the replica set monitor, then disconnects
1006-
from all members of the replica set. Once called this instance
1007-
should not be reused.
1006+
from all members of the replica set.
1007+
1008+
.. warning:: This method stops the replica set monitor task. The
1009+
replica set monitor is required to properly handle replica set
1010+
configuration changes, including a failure of the primary.
1011+
Once :meth:`~close` is called this client instance must not be reused.
10081012
10091013
.. versionchanged:: 2.2.1
10101014
The :meth:`close` method now terminates the replica set monitor.

0 commit comments

Comments
 (0)