-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Kill a postgres container immediately #1261
Comments
A simple docker kill should work
or
|
Did you time it? It takes 10 seconds and that error appears in docker daemon. It seems like the image is trapping the signal and not passing it along to postgres |
I am not using a signal, just forcing the container to be destroyed
|
Something else is going on here, b/c that takes 10 seconds for me and for Jenkins
|
My best guess would be the recent AppArmor snafu where Docker itself got denied from sending signals to runc. |
10 seconds is the default --stop-timeout, maybe try setting it to a low value? For example: docker run -d --rm --stop-timeout 1 --name postgres -e POSTGRES_PASSWORD=1234 postgres |
The stop-timeout flag is ignored here
Daemon logs
|
Unless you have an ancient Docker engine, I doubt that it doesn't support it:
If that's being ignored, how do we know that the rest, for example But most importantly, what you seem to be using is the bitnami/postgresql image, where's this is the postgres image repo. Maybe try asking there for help? |
Yeah stop timeout has been around for a long time, so I don't think its my daemon being out of date. Running latest ubuntu. Here's the same issue with this postgres container. I wouldn't be opposed to some daemon flags to fix this, Im just not clear why the kill command is being ignored.
Here's my server version. I've been able to reproduce this on OS X and linux
|
|
See https://github.com/moby/moby/blob/96898c8be6103ba65f3096782cb9bca65701bf1c/daemon/kill.go#L161 for where that 10s |
I think you're right about apparmor, I see a bunch of references to postgres getting a docker-default apparmor policy. Ill try to leave this open until I figure out how to disable apparmor blocking |
See moby/moby#47749 for links to the specific issue I'm talking about |
I'm spinning up postgres containers for unit tests, so I don't care at all if they are corrupted on exit. I have been unable to find any way to kill these in less than 10 seconds.
Here is what I have tried and has not worked.
docker rm -f {pid}
10 secondsdocker kill --signal SIGQUIT {pid}
10 seconds. Actually SIGQUIT will give a permission error heredocker stop -t 1 --sginal SIGQUIT {pid}
10 seconds. Is this timeout even respected?I see these errors in the docker daemon:
How do I terminate these containers immediately?
The text was updated successfully, but these errors were encountered: