We have a Postgres and PgBouncer setup and use SIGINT for graceful termination based on the pgbouncer docs:
SIGINT Safe shutdown. Same as issuing PAUSE and SHUTDOWN on the console.
The pre stop hook script looks like this:
kill -INT 1; sleep 270;
But pgbouncer sometimes can't quit in time and some inserts and other possible commands are dropped causing data integrity issues.
Does anyone know a good way to debug this? Are we able to log hang queries or anything like this?