For security updates (mainly for Linux kernel updates) we need to restart the database server (e.g. weekly). It’s a PostgreSQL installation with about 200M records on Ubuntu.
The problem is that during the database restart there are always some application errors:
Some like this:
ActiveRecord::ConnectionNotEstablished: could not connect to server: Connection refused
And other similar, like this:
PG::Error: could not connect to server: Connection refused
Is this normal? Or there are better ways to handle this short downtime (a few seconds) during db restart?
I expected ActiveRecord to retry the connection for some seconds