Closed robsdedude closed 1 month ago
Hi @ccloes and thanks for sharing the stack trace.
This is a very unexpected code-path, I must admit. Right after the async socket has been opened, writer.transport.get_extra_info("sockname")
is being called. According to the docs and looking at the source code of asyncio
, get_extra_info("sockname")
will be None
if there was an error receiving this information. The different transport implementations try to get the sockname
pretty much right after the socket connection has been established. So there really should be that information about the connection.
I was not able to reproduce this condition locally, so can you please provide me with additional information that should help me pin-point how this came to be:
Please enable debug logging for all loggers and share the logs with me. You could, for instance use the driver's helper for that
from neo4j.debug import watch
watch("")
Some of the async TCP transport implementations log errors when trying to compute the sockname
for caching it in extra. Further, I'll be able to see what the failing connection was up to before the error occurred.
pip install -U git+https://github.com/robsdedude/neo4j-python-driver@async-sockname
. It will hopefully turn this TypeError: 'NoneType' object is not subscriptable
into the underlying OSError
that caused the caching of sockname
to fail and therefore it to be None
.One last attempt as I'd really like to dig into this issue but can't reproduce it on my own.
@ccloes please help me (see comment above).
@MarkPAndrews can you help us get this reviewed?
@robsdedude sorry for the delay... we are asking for Mark with Neo4j to help get this worked.
We discussed with this the Neo4j team, and we are going to try and push this to later when we revisit hardening the connector code in Nodestream and doing some of the performance testing work that is planned.
The issue manifested itself under high load, and when leader elections were happening on the database side.
We can close this ticket for now until we are better able to reproduce the issue.
Thank you for coming back on this. As you suggested, I'll close this issue for now.
For future you or anyone else coming across this issue: feel free to reopen this issue while providing the additional information requested in my earlier comment. The linked custom driver version might not exist anymore though.
Originally posted by @ccloes in https://github.com/neo4j/neo4j-python-driver/issues/730#issuecomment-2086020445