brettwooldridge / HikariCP

光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Apache License 2.0
19.63k stars 2.9k forks source link

hikaricp logs exception, then rethrows it #2172

Open hgschmie opened 4 months ago

hgschmie commented 4 months ago

the eviction code at https://github.com/brettwooldridge/HikariCP/blob/dev/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java#L178 logs an exception that caused a connection to be marked as bad but then rethrows it.

We have some situations where we expect connection states changes caused by exception and we catch and process the exceptions accordingly (never log them, because they are normal operational state). However, HikariCP still logs them (and fills our logs).

Would it be possible to add a switch that suppresses logging the exception (the "WARN - Connection broken because of ..." is fine, just the full exception stack trace is too much)?