AG-305 - Use Connection.setNetworkTimeout as a hard backstop in ConnectionValidator#sqlValidator#184
Merged
barreiro merged 1 commit intoagroal:masterfrom May 4, 2026
Conversation
gsmet
reviewed
Apr 14, 2026
Collaborator
|
Hi @gastaldi, just thinking about AgroalPropertiesReader. Actually only validation timeout is supported. It's also integrated into Spring-Boot starter to configure validator. Might worth thinking about a backwards compatible enhancement! 🤔 |
Collaborator
Author
|
I've now introduced |
bbd2479 to
c4cd2e9
Compare
c729f92 to
5605419
Compare
Collaborator
Author
|
I can confirm that this method fixes quarkusio/quarkus#49976, I'll submit a PR using it in Quarkus meanwhile |
5605419 to
da5fc5b
Compare
gastaldi
commented
Apr 29, 2026
da5fc5b to
0944cba
Compare
f6605c9 to
1197fe7
Compare
graben
reviewed
May 3, 2026
4f06169 to
3dda541
Compare
gastaldi
commented
May 3, 2026
3dda541 to
9dc23f3
Compare
graben
reviewed
May 3, 2026
9dc23f3 to
f0eec65
Compare
f0eec65 to
7e752bb
Compare
Set a network timeout on the connection before executing the validation SQL so that an unresponsive network cannot hang the pool indefinitely. The network timeout is set higher than the query timeout (default +5s buffer) to give setQueryTimeout a chance to cancel the statement cleanly before the socket is forced closed. Add a new sqlValidator overload that accepts an explicit network timeout Duration for environments that need to tune the backstop independently.
7e752bb to
7ab2816
Compare
graben
approved these changes
May 3, 2026
barreiro
approved these changes
May 4, 2026
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.
Statement.setQueryTimeoutrelies on the driver sending a cancel signal to the server, which may not work when the connection is stuck at the network level (e.g. network partition, firewall dropping packets).Setting a network timeout on the socket ensures validation will return within the configured timeout regardless of server cooperation.