Skip to content

glsql: wait for connections to be released

John Cai requested to merge jc-fix-database-connection-leak into master

When we clean up a test database connection, we issue a pg_terminate_backend to all pids. However, though pg_terminate_backend will return success, that just means at least one signal was sent. https://man7.org/linux/man-pages/man2/kill.2.html#RETURN_VALUE It does not necessarily mean that the connection has actually been released. This is leading to flakiness in our tests with pgbouncer. This change waits for all other connections to be released before attempting to drop the database.

Merge request reports