Rolling deploys of payment-worker are crawling. Every restart sits for about 10 seconds on docker stop, and afterwards the container shows up as Exited (137) instead of a clean Exited (0). The web container next to it stops instantly. Something about how payment-worker shuts down is wrong — find it.
payment-worker — a queue worker, myworker:3.0.1, up 5 hours.web — nginx:alpine, up 5 hours, on 80 (the healthy comparison).$ docker stop web
web
$ docker ps -a --filter name=web
CONTAINER ID IMAGE STATUS NAMES
ab12cd34ef56 nginx:alpine Exited (0) 2 seconds ago web
$ docker stop payment-worker # hangs ~10s, then:
payment-worker
$ docker inspect -f '{{.State.ExitCode}}' payment-worker
137
You've solved it when:
payment-worker ignores SIGTERM: `dockerSIGKILL, so the container exited 137 (128 + 9) — not a clean 0
like web. This is an application signal-handling bug, not a daemon or
disk fault.
payment-worker (it is now Exited).docker CLI only.docker ps -a / docker inspect.
SIGTERM-ignoring PID 1 produce 137 and not, say, 143128 + 15, SIGTERM)?
docker stop vs docker kill here — which signal does each send first,kill get the same 137?
exec vs shell) and what init (--init/tini)SIGTERM?