fix: bound ArangoDB connection check with an explicit timeout#149
Open
Logaka wants to merge 13 commits into
Open
fix: bound ArangoDB connection check with an explicit timeout#149Logaka wants to merge 13 commits into
Logaka wants to merge 13 commits into
Conversation
checkConnection() ran a synchronous "RETURN 42" query whose underlying CompletableFuture.get() has no deadline. When a pooled connection goes stale (silent TCP, e.g. cluster failover) the call blocked forever — the driver's socket timeout only covers connection establishment, not in-flight requests. In production this pinned the synchronized health service monitor, blocking all Tomcat workers and failing readiness. Run the check on a daemon executor and cap it with future.get(timeout). Wire the existing dbaas.arangodb.timeout property through Service/TenantDbaasArangoConfiguration into ArangoDatabaseProvider via a new constructor arg (default 60s). Fix DbaasArangoTemplateTest which NPE'd now that checkConnection reads dbaasArangoConfig.
… failover Replace newCachedThreadPool with ThreadPoolExecutor(5,5,LinkedBlockingQueue) in ArangoDatabaseProvider and DbaasArangoTemplate. Add test verifying that the executor slot is released after checkConnectionTimeoutMs via future.cancel(true).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
checkConnection() runs a synchronous RETURN 42 query. Under the hood the ArangoDB driver blocks on CompletableFuture.get() with no deadline. When a pooled connection goes stale — TCP stays open but the server stops responding, e.g. during a cluster failover — the call blocks forever. The driver's timeout
setting only covers connection establishment, not in-flight requests over an already-pooled connection.
Fix
Tests