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?