Skip to content

Commit 9d1efce

Browse files
authored
API docs: Driver.close is not concurrency-safe (#1147)
1 parent ade8d05 commit 9d1efce

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/neo4j/_async/driver.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,15 @@ def _prepare_session_config(cls, config_kwargs):
642642
return config_kwargs
643643

644644
async def close(self) -> None:
645-
"""Shut down, closing any open connections in the pool."""
645+
"""Shut down, closing any open connections in the pool.
646+
647+
.. warning::
648+
649+
While the driver object is concurrency-safe, ``close`` is *not*.
650+
Make sure you are not using the driver object or any resources
651+
spawned from it (such as sessions or transactions) while calling
652+
this method. Failing to do so results in unspecified behavior.
653+
"""
646654
# TODO: 6.0 - NOOP if already closed
647655
# if self._closed:
648656
# return

src/neo4j/_sync/driver.py

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)