Safe to kill DB connection for a few seconds?

Hi everyone,

We currently use HAProxy as a loadbalancer and want to reload the configuration without restarting in order to avoid downtimes. That creates new HAProxy processes and the old ones should exit as soon as there are no connections open anymore.
This does not work as I hoped with AWX as the dispatcher will not close its LISTEN connection to our external PostgreSQL.
I am not sure whether it is safe to just close the connection.
I tried it in a test environment and AWX creates a new connection. So far so good.
But is it safe to just cut the DB connection? Could that result in data loss from running jobs or issues with scheduling jobs etc? Maybe there are even more side effects I am not considering?

For reference, we are using:
Operator v0.16.0
AWX v19.5.0
K3s v1.22.2
PostgreSQL 13

Hi,

The easy answer here is that no, it’s not really safe. We are investigating ways to make AWX more resilient to these kinds of operations.

Seth