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

isConnectionDead logs warnings when the connection should simply be closed #2210

Closed
bh-tt opened this issue Jun 26, 2024 · 1 comment
Closed

Comments

@bh-tt
Copy link

bh-tt commented Jun 26, 2024

We recently encountered an increased number of warnings from hikari, all about failing to validate a connection before borrowing it from the pool. The log line in question is HikariPool-2 - Failed to validate connection org.mariadb.jdbc.Connection@294613b0 ((conn=55230) Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.

This appears to come from Poolbase.isConnectionDead, which does 2 setNetworkTimeout calls (both before validation to the validationTimeout and afterward to reset the network timeout back to what it was). If the connection was closed due to errors (at least for the mariadb 3.x driver) the setNetworkTimeout call itself results in an SQLException, which is then logged as a warning. The result is a large number (thousands/day) of warnings about the connection being closed from a method that is supposed to determine whether the connection is closed.

This method should not log warnings (maybe info or debug?) when a return value of false is an expected result (e.g. the connection should not be used, evict it).

I think there are 2 ways to fix this:

@bh-tt
Copy link
Author

bh-tt commented Jun 26, 2024

Well we found the underlying error: very high system load, likely causing network issues. I'll close this.

@bh-tt bh-tt closed this as completed Jun 26, 2024
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