brettwooldridge / HikariCP

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

Return error quickly when database is down #2254

Closed denis-arruda closed 1 month ago

denis-arruda commented 1 month ago

Is it possible to configure Hikari to quickly return an error when Hikari knows that all connections are down? Looks like it always tries to open a new connection and the request has to wait until it gets a connection timeout.

quaff commented 1 month ago

What if the database is recovered at the time?

denis-arruda commented 1 month ago

If previous connections already failed. And we already have a thread trying to connect. Should we answer quickly an error message to other threads meanwhile?

brettwooldridge commented 1 month ago

It is not the pool's responsibility to determine if the database is never coming back. It is possible to reboot the database server, have it down for minutes, and have the pool recover.