You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the JDBC connection won't work on startup, Jooby will hang forever.
I've encountered the issue when deploying a Kubernetes cluster, my Jooby instance starts faster than MySQL and gets communication link failure and just hangs. As soon as MySQL start it keeps running, while Jooby is hanging 😴
Is there a way to configure either Jooby or HikariCP to try to reconnect periodically?
The text was updated successfully, but these errors were encountered:
I found the reason, initializationFailTimeout is by default set to 1, so if a connection cannot be made the pool will fail fast. Setting it to -1 will bypass that, and will try to get connection in background.
I've tried it as follows
Shutdown MySQL
Start jooby (Start successfully
Query my database dependent endpoint - fails on connection refused
Start MySQL
Query the endpoint again. Now it works!
Quote from HikariCP documentation:
A value less than zero will bypass any initial connection attempt, and the pool will start immediately while trying to obtain connections in the background. Consequently, later efforts to obtain a connection may fail. Default: 1
If the JDBC connection won't work on startup, Jooby will hang forever.
I've encountered the issue when deploying a Kubernetes cluster, my Jooby instance starts faster than MySQL and gets communication link failure and just hangs. As soon as MySQL start it keeps running, while Jooby is hanging 😴
Is there a way to configure either Jooby or HikariCP to try to reconnect periodically?
The text was updated successfully, but these errors were encountered: