PYTHON-4347 Ensure client can be opened after fork() (#1682)

This commit is contained in:
Shane Harvey 2024-06-13 14:35:42 -07:00 committed by GitHub
parent e059fdef6b
commit 2e39101f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -904,6 +904,7 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
# this closure. When the client is freed, stop the executor soon.
self_ref: Any = weakref.ref(self, executor.close)
self._kill_cursors_executor = executor
self._opened = False
def _after_fork(self) -> None:
"""Resets topology in a child after successfully forking."""