Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cnkailyn opened this issue Apr 29, 2024 · 2 comments
Labels

Comments

@cnkailyn
Copy link

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 cnkailyn added the bug label Apr 29, 2024
@robsdedude
Copy link
Member

robsdedude commented May 2, 2024

Hi and thanks for the bug report. It'd be a great help for me if you could share some extra information with me so that I can understand the problem in more detail:

  • What operating system are you using?
  • What event loop are you running? I'm suspecting that this is run using uvloop and not asynio.
  • Please share the full stack trace of the error (ideally as text, and not a screenshot, but better a screenshot than nothing)
  • If you can reproduce the error, I'd be very happy to see driver debug logs so that I can see what the connection in question was doing before the failure. Here are the API docs on how to enable the debug logs: https://neo4j.com/docs/api/python-driver/current/api.html#logging

@robsdedude
Copy link
Member

Hello again @cnkailyn 👋

Can you please share the requested information so that I can start investigating?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants