neo4j-python-driver
neo4j-python-driver copied to clipboard
When pool connection is not heath, the connection.close() sometime will raise an exception.
Backgroud:
I got an issue raised from neo4j:
this this the exception logs:
Then I checked the source code here:
The direct issue is the connection is not health, maybe the TCP have already closed, but we still call connection.close(), then it raise that 'RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x56126bcdf100>; the handler is closed'.
there should add a try for connection.close() or add some conditions like:
if not conncetion.tcp.closed: conncetion.close()