Open jkoleti-uptycs opened 3 months ago
Note that this race happens when the ExecuteWrite pool Return invokes unreg() (because connection is old?) and this launches a go routine to Close the connection which cannot even begin to run until after the connection put in the Idle list. When ExecuteWrite returns the session could then be closed by the caller, which launches a Cleanup, which will close the old connections in the Idle List in more go routines. It is not safe to leave the Close to run asynchronously from the main flow of ExecuteWrite unless there is a lock in Close to prevent two simultaneous Closes from running.
Hey there!
Thanks for sharing the stack trace and your observations, it's very helpful. I've bumped up the priority on this one because it looks like it might be tied to the previous issue https://github.com/neo4j/neo4j-go-driver/issues/525 and we now have a bit more info to work with. I'll keep you in the loop with any updates or breakthroughs.
Is there any update on this. We are seeing the same / similar behavior.
Hi @aniketkdm, are you seeing this problem using a Neo4j server, and if so which version? I'm just asking as the original issue was around Memgraph.
Hello @StephenCathcart, yes we are seeing same / similar problem. We are using Neo4j aura through GCP and when we are running heavy load (reads and writes) we get %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)
randomly. We have tried adding recovery functions in our code but the panics are not getting recovered in our function. We are using github.com/neo4j/neo4j-go-driver/v5 v5.18.0. Even with the recovery functions, we are not getting stacktrace for these panics.
To chime in, we're also seeing this issue
neo4j:5.19.0-enterprise
(three kubernetes statefulsets on EKS)github.com/neo4j/neo4j-go-driver/v5 v5.20.0
Thanks for the extra information @aniketkdm and @justinwalz that narrows things down quite a bit.
Our Database setup
We are using the neo4j go driver for connecting to our memgraph database with default config. One of our applications is getting panicked while running cypher queries. So built our application with the
-race
flag enabled and below is the stack trace for a panic.This issue is happening randomly, the occurrence of this issue is not predictable.
Saw a similar issue that was closed here - https://github.com/neo4j/neo4j-go-driver/issues/525