-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker stop results in SIGTERM being sent #184
Comments
I've not seen an issue in stopping a postgres container (though mine don't usually have much data or load) and so mine stop almost instantly after receiving |
I experience the same all the time, did you find a better solution @yntelectual? |
I had actually experienced data corruption because postgress process was SIGKILLed in the middle of flushing logs. |
As referenced above, your best bet is to run
Additionally, you might have luck with specifying In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. |
Well, as stated in https://www.postgresql.org/docs/10/static/server-shutdown.html:
So if the connection is idle in another process, 60 seconds may never be enough. About
https://paquier.xyz/postgresql-2/postgres-9-5-feature-highlight-pgctl-default-mode/ Since we don't have a fine-grained shutdown control order in docker I'm using the stop_signal to change the behavior and get a clean shutdown with
I think you can change the |
Given that SIGTERM is more graceful (and less likely to break folks'
databases), I'm wary of explicitly changing that.
|
Sure, this is the safest choice. I'm not saying to change the default signal. What I really want to say is: As everyone should know their own application and their workload, that may be the tip someone needs to tweak their needs. |
Hi,
is there something wrong about using
docker stop
to shutdown the postgres container?After examining the logs I notice the following:
Even if I run
docker stop --time=60 postgres
, the stop just waits for those 60 seconds, after which it probably sends SIGKILL causing the postres shutdown and subsequent warning during start.Thanks for any info
The text was updated successfully, but these errors were encountered: