-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
This is directly related to these issue that were (IMHO incorrectly) closed:
- docker stop results in SIGTERM being sent #184
- Shutting down postgres gracefully with docker-compose down to avoid recovery process #544
There is a misconception that sending "SIGTERM is more graceful". Generally that is true, however considering how Postgres interprets signals (https://www.postgresql.org/docs/11/server-shutdown.html), that simply doesn't guarantee to shutdown Postgres cleanly.
According to the docs the only way to guarantee a graceful shutdown without dataloss is using SIGINT
.
Note that in a lot of production environments (e.g. in Kubernetes clusters) containers might be stopped at unexpected moments using the default signal, and in a lot of those environments connections to the server will not be closed by the clients in time (since they generally don't know the server is shutting down). Ergo, there are a lot of production setups in which the default image is not usable because it will lead to corrupted data.
I'd be happy to create a PR for this, but I have a feeling that some discussion is needed first.