Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDocker container doesn't stop running after graceful shutdown in Kubernetes #2070
Comments
brian-brazil
added
the
kind/bug
label
Oct 26, 2016
This comment has been minimized.
This comment has been minimized.
gargath
commented
Feb 22, 2017
•
|
I'm seeing a very similar behaviour. The only difference I can see that in my case, the last log line is
After that, the pod hangs and is stuck in "terminating" state forever. It seems that even a SIGKILL won't dislodge it in my case. EDIT: This is a big issue for me because it prevents the pod from being rescheduled by Kubernetes. |
This comment has been minimized.
This comment has been minimized.
ampedandwired
commented
Mar 27, 2017
|
I'm seeing this also. Worse, it seems to result in a crash recovery after every shutdown. |
This comment has been minimized.
This comment has been minimized.
|
If you look at the goroutine dump, you should get an idea what Prometheus is waiting for. |
This comment has been minimized.
This comment has been minimized.
ampedandwired
commented
Mar 30, 2017
|
Thanks, in my case shutdown was simply taking a very long time due to the server being under-resourced. Have done some performance tuning and it's all good now. |
brian-brazil
closed this
May 24, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
JorritSalverda commentedOct 10, 2016
terminationGracePeriodSeconds: 150
What did you do?
Kubernetes sends SIGTERM to applications to initiate their graceful shutdown. The prom/prometheus:v1.2.0 container does start its graceful shutdown correctly. However once finished with the shutdown the container keeps running until Kubernetes sends the SIGKILL after the default 30 seconds or configurable period (via terminationGracePeriodSeconds).
What did you expect to see?
As soon as the graceful shutdown on SIGTERM has finished the container should stop running.
What did you see instead? Under which circumstances?
The container stays operational until SIGKILL is sent. With a very long terminationGracePeriodSeconds - which is set to allow for proper shutdown, which can take up to a couple of minutes for larger data sets - you have to wait for a long time, even if graceful shutdown is finished within seconds.
Environment
Linux 4.4.14+ x86_64
prometheus, version 1.2.0 (branch: master, revision: 522c933)
build user: root@c8088ddaf2a8
build date: 20161007-12:53:55
go version: go1.6.3