Automatically reconnecting to restarted databases
-
Hello, we currently have FusionAuth running in silent mode on a Docker container in our test/QA environment. We noticed that after our cloud database was restarted, FusionAuth went down and attempts to access the UI were given the
Silent Configuration Mode Failed
response page. Is there a configuration setting(s) that would allow FA to automatically check and re-connect to a database that has been restarted beneath it, as opposed to having to manually restart the container?
Thanks!
-
Hmmm.
You didn't specify if you were using mysql or postgresql. That has an impact on your options.
You could try increasing the size of the connection pool after the restart; new connections would succeed. Not sure if the connection pool FusionAuth uses is smart enough to reap the failed connections, but might be worth exploring.
It looks like hikari (the connection pool) does support auto reconnect after database failure, but only at a certain version of the driver and with certain socket connection settings: https://github.com/brettwooldridge/HikariCP/issues/1056
You can control the socket connection setting with the DATABASE_CONNECTION_TIMEOUT env var. And I verified that the version of the PG library is higher than that referenced in the github issue.
Were there any other logs available?