-
Notifications
You must be signed in to change notification settings - Fork 169
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
restart_process
restart-helper leaks zombie processes
#570
Comments
hmmm...i was not able to reproduce this problem. here are the steps i tried:
when i poked around in the |
I'm running into a sort of similar situation where a process can be left around hanging as a zombie process. I tried to create a reproducable testcase and came up with something which creates a zombie process. diff --git a/restart_process/test/Dockerfile.test b/restart_process/test/Dockerfile.test
index cfbeb9f..89e11d3 100644
--- a/restart_process/test/Dockerfile.test
+++ b/restart_process/test/Dockerfile.test
@@ -1,5 +1,7 @@
FROM alpine
+RUN apk add nginx
+
RUN echo 0 > restart_count.txt
ADD start.sh /
diff --git a/restart_process/test/start.sh b/restart_process/test/start.sh
index c9bc981..6277158 100755
--- a/restart_process/test/start.sh
+++ b/restart_process/test/start.sh
@@ -12,8 +12,13 @@ handle_sigterm() {
trap handle_sigterm SIGTERM
-while true
-do
- echo running
- sleep 5
+while pgrep -f nginx >/dev/null ; do
+ echo "waiting for nginx to shut down"
+ set +e
+ pkill -f nginx
+ set -e
+ sleep 3
done
+nginx
+
+tail -F /var/log/nginx/*
Going into the container and running
The pid 25 is there as a zombie. I assume the issue is tilt-restart-wrapper not reaping zombies, which should be a job of a process running as PID 1. |
Thanks for the reproduction @samuliy. Until this is fixed, there is a simple workaround if this doesn't cause issues with your workload or sidecars: {{- if .Values.tilt }}
# Fix zombie processes not stopping under Tilt
shareProcessNamespace: true
{{- end }} |
@nicks can you remove the needs repro case label? |
Seems like it might need a minimal init (tini, dumb-init, etc).
I noticed this because entr also doesn't reliably kill the process before starting a new one... perhaps this is because of
sh
, I'm not sure. That's a different issue.The text was updated successfully, but these errors were encountered: