neo4j-python-driver icon indicating copy to clipboard operation
neo4j-python-driver copied to clipboard

When pool connection is not heath, the connection.close() sometime will raise an exception.

Open cnkailyn opened this issue 1 year ago • 0 comments

Backgroud: I got an issue raised from neo4j: this this the exception logs: image image

Then I checked the source code here: image

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()

cnkailyn avatar Apr 29 '24 08:04 cnkailyn