Skip to content

minor breaking change in PgBouncer 1.23.x - change in SIGTERM behaviour

Summary

This is a proactive bug issue!

https://www.pgbouncer.org/changelog.html#pgbouncer-123x

SIGTERM doesn’t cause immediate shutdown of the PgBouncer process anymore. It now does a “super safe shutdown”: waiting for all clients to disconnect before shutting down. The new SIGTERM behaviour allows rolling restarts of multiple PgBouncer processes behind a load balancer, or listening on the same port using so_reuseport. This is a minor breaking change. If you relied on the old behaviour of SIGTERM in your Dockerfile or Systemd service file you should now use SIGQUIT

Omnibus 17.1.1 ships PgBouncer 1.22.1, so I imagine it's not that long until the next time we bump PgBouncer.

Workaround

For now, one can:

  • Wait longer and try the reconfigure command again.
  • or manually send a SIGQUIT to the pgbouncer pid to stop it right away.
  • or experiment with SVWAIT environment variable by setting it to something longer than 7 seconds, and retrying the reconfigure.

Steps to reproduce

What is the current bug behavior?

This change in behaviour may break our deployment and use of PgBouncer

What is the expected correct behavior?

  • Review assumptions about behaviour of PgBouncer prior to upgrading to 1.23.x
  • Update our code to handle this new behavior or create follow-up issue if the change is more than a quick win
Edited by João Alexandre Cunha