We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6a4a10 commit c1bfb87Copy full SHA for c1bfb87
neo4j/io/__init__.py
@@ -639,7 +639,13 @@ def time_remaining():
639
while True:
640
# try to find a free connection in pool
641
for connection in list(connections):
642
- if connection.closed() or connection.defunct() or connection.stale():
+ if (connection.closed() or connection.defunct()
643
+ or connection.stale()):
644
+ # `close` is a noop on already closed connections.
645
+ # This is to make sure that the connection is gracefully
646
+ # closed, e.g. if it's just marked as `stale` but still
647
+ # alive.
648
+ connection.close()
649
connections.remove(connection)
650
continue
651
if not connection.in_use:
0 commit comments