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

Question about validation-timeout behavior in HikariCP #2295

Open
songpang opened this issue Feb 24, 2025 · 0 comments
Open

Question about validation-timeout behavior in HikariCP #2295

songpang opened this issue Feb 24, 2025 · 0 comments

Comments

@songpang
Copy link

Hello,

I conducted a test to verify how the validation-timeout setting works in HikariCP under specific conditions.

Here is my setup:

A Spring Boot application running locally
A MySQL database running locally
A toxiproxy-server running locally, forwarding port 3306 to 3307, and adding a 6000ms latency

I wanted to observe how validation-timeout behaves in this situation. While making normal API calls, I added latency in the middle of the test. As expected, a log message indicating validation failure appeared.

However, based on the code:

final var validationSeconds = (int) Math.max(1000L, validationTimeout) / 1000;

If validation-timeout is set to 2500, the failure log should appear after 2 seconds, but instead, it appears 4 seconds after the API call.

When I set it to 1500, the log appears 2 seconds later.
When I set it to 3500, the log appears 6 seconds later.
From this pattern, it seems that the actual validation-timeout value becomes twice the expected value after dividing by 1000. What could be causing this issue?

Additional Test

I also performed another test where I disabled Wi-Fi after starting the local application to see how it behaves. In this case, it worked as expected.

With validation-timeout set to 2500, the log appeared after approximately 2 seconds.
Could you help me understand why this discrepancy occurs?

Thank you.

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

No branches or pull requests

1 participant