Skip to content

fix: one Bolt connection per thread, not one per pool - #90

Merged
seuros merged 2 commits into
masterfrom
fix/thread-safe-connections
Sep 19, 2026
Merged

seuros merged 2 commits into
masterfrom
fix/thread-safe-connections

Conversation

@seuros

@seuros seuros commented Sep 19, 2026

Copy link
Copy Markdown
Owner

No description provided.

The pool handed one adapter to every thread and only guarded creation, so
concurrent queries interleaved on a single Bolt socket and corrupted the
stream. Connections are now per thread, tracked for disconnect, and dead
threads' sockets are reaped and closed.

Also adds ConstraintError and TransientError, mapped from server error
codes for both Neo4j and Memgraph.
Memgraph answers write/write conflicts with a TransientError that means
"try again". Auto-commit queries now retry up to 3 times with full
jitter. Explicit transactions are not retried: the caller owns those and
earlier statements may already have applied.
@seuros
seuros merged commit 8ab4d2a into master Sep 19, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant