[winery] drop_database() should revoke connect privileges before running pg_terminate_backend
swh.objstorage.backends.winery.database.DatabaseAdmin.drop_database() currently calls pg_terminate_backend
to shutdown existing connections before running DROP DATABASE
. As there might be some delay before resources are freed, the DROP
is retried every 10 seconds. But new connections according to my understanding, new connections could be made between each `DROP statements, preventing the database from every be released.
The stackoverflow solution mentioned in the comment recommends running REVOKE CONNECT
before running pg_terminate_backend
, and it is probably missing here, unless we have other guarantees that no new connections will be made, but I don’t see any while running through the code.