MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _after_fork_child

Function _after_fork_child

pymongo/asynchronous/mongo_client.py:3056–3065  ·  view source on GitHub ↗

Releases the locks in child process and resets the topologies in all MongoClients.

()

Source from the content-addressed store, hash-verified

3054
3055
3056def _after_fork_child() -> None:
3057 """Releases the locks in child process and resets the
3058 topologies in all MongoClients.
3059 """
3060 # Reinitialize locks
3061 _release_locks()
3062
3063 # Perform cleanup in clients (i.e. get rid of topology)
3064 for _, client in AsyncMongoClient._clients.items():
3065 client._after_fork()
3066
3067
3068def _detect_external_db(entity: str) -> bool:

Callers

nothing calls this directly

Calls 3

_release_locksFunction · 0.90
itemsMethod · 0.80
_after_forkMethod · 0.45

Tested by

no test coverage detected