<div dir="ltr">Hi guys,<div><br></div><div>I deployed <a href="https://github.com/bitnami/bitnami-docker-pgpool" target="_blank">Bitnami&#39;s pgPool</a> as a Kubernetes container sidecar to proxy database queries from our API server to a Postgres DB. The DB is <a href="https://cloud.google.com/sql/docs/postgres" target="_blank">run and managed by Google </a>and has a master and 1 replica. The primary aim of this setup is to load-balance SQL statements between the Postgres master and its replica and the config pretty much follows pgpool&#39;s <a href="https://www.pgpool.net/docs/latest/en/html/example-aurora.html" target="_blank">Aurora guide</a>.</div><div><br></div><div>Upon updating the API server deployment, the pod gets terminated by Kubernetes by sending a SIGTERM signal. Thus our API server and pgpool processes running in separate containers within a single pod, will receive SIGTERM at the same time. API server handles SIGTERM and starts a graceful shutdown and so does pgpool. The pgpool&#39;s smart shutdown ensures child processes end gracefully. i.e. it waits for all clients to finish up and disconnect. However, I still see errors in my API server logs indicating the connection was closed by the pgpool.</div><div><br></div><div>Upon investigation it seems pgpool was not able to gracefully shutdown within a defined period (30s) and it was SIGKILLed by Kubernetes. API server logs show few hanging (&gt; 20s) requests doing coupole of DB read queries. Usually these requests finish within a few ms. pgpool logs show me nothing (using default log config). Do you have any suggestion on what could be going on and how to best troubleshoot this? Could I get detailed logs from pgpool to follow the smart  shutdown sequence? Or is there maybe pgpool misconfiguration which prevents the correct and quick shutdown.</div><div><br></div><div>Many thanks,</div><div>-Michal</div></div>