Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Endpoint script doesn't handle SIGTERM properly #82

Open
ciera opened this issue Sep 28, 2015 · 0 comments
Open

Endpoint script doesn't handle SIGTERM properly #82

ciera opened this issue Sep 28, 2015 · 0 comments
Labels

Comments

@ciera
Copy link
Contributor

ciera commented Sep 28, 2015

Our endpoint script doesn't handle SIGTERM properly. This means that when we run docker stop, we get a SIGTERM, disregard it, wait until the timeout, then receive the SIGKILL.

Workaround: we can run with docker stop -t 0, which will immediately SIGKILL. Fine for now since we don't have any cleanup, but we should probably do this correctly...

Lots of info about this:
The original discussion on github: moby/moby#3240
Docker and PID 1: http://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
Exec v. shell form (we are using exec form): https://docs.docker.com/reference/builder/#entrypoint
Other projects that ran into this, and their solutions:
moby/moby#2436
https://gist.github.com/zba/27d9e54e7293c1bb2da4
http://veithen.github.io/2014/11/16/sigterm-propagation.html (<-----we may need this one)
moby/moby#3766

Most people seem to solve this problem by (1) using exec mode when starting their service (we already do that) and (2) if the entrypoint is a shell script, using exec when starting their service there. This however, will only work if you have a single service you are starting. We have several.

I suspect this means we need to actually trap the signal in our shell script.

@ciera ciera added the P3 label Sep 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant