neo4j / neo4j-python-driver

Neo4j Bolt driver for Python
https://neo4j.com/docs/api/python-driver/current/
Other
883 stars 187 forks source link

Mitigate errors during resource warning on interpreter shutdown #1037

Closed robsdedude closed 3 months ago

robsdedude commented 3 months ago

According to https://github.com/neo4j/neo4j-python-driver/issues/1024 errors can still happend during interpreter shutdown when user code is not closing the driver properly. This PR should hopefully fix this for good (1st attempt made here https://github.com/neo4j/neo4j-python-driver/pull/942).

The solution is inspired from Python's std lib. See https://github.com/python/cpython/blob/v3.12.3/Lib/multiprocessing/pool.py#L264-L271