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

Liveness check #756

Merged
merged 5 commits into from
Dec 6, 2023
Merged

Liveness check #756

merged 5 commits into from
Dec 6, 2023

Conversation

thelonelyvulpes
Copy link
Contributor

@thelonelyvulpes thelonelyvulpes commented Dec 5, 2023

This change introduces a liveness check timeout.

  • Liveness checks will be completed when borrowing a pooled connection, given that the connection has been idle longer than the timeout.
  • The driver, by default, will not add liveness checks, but this can be configured with WithConnectionLivenessCheckTimeout on the ConfigBuilder.
using var driver = GraphDatabase.Driver(uri, creds, 
    cb => cb.WithConnectionLivenessCheckTimeout(TimeSpan.FromSeconds(30));

Using a timeout of 0, all connections will complete a liveness check when taken from the pool; this ensures connections are healthy but comes at the cost of performance when running queries or starting transactions.

@thelonelyvulpes thelonelyvulpes marked this pull request as ready for review December 6, 2023 11:30
@thelonelyvulpes thelonelyvulpes merged commit 6c91e8e into neo4j:5.0 Dec 6, 2023
5 checks passed
@thelonelyvulpes thelonelyvulpes deleted the liveness-check branch December 6, 2023 16:08
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.

None yet

2 participants