I have a docker image which executes a shell script that runs a series of Java programs.
I am finding that the script does not complete; on examination I find that one of the Java executables exited but is a zombie - the caller failed to reap the exit status.
I’ve simplified the scripts to a bare minimum and it’s consistently reproducible.
The script that’s executed when the container is:
for f in 1 2 3 4 5 6 7 8 9 10
echo do $f
/tmp/bar is very simple too:
java >> /tmp/j.out 2>&1
On startup the container never completes. It’s not consistent; the log may show that the first Java invocation was successful but it never gets through all 10. The same happens if I log on to the container using docker exec and run the script manually.
ps shows a java zombie, although what’s interesting is that unlike a normal Unix zombie the TIME field continues to increase.
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 01:23 ? 00:00:00 /bin/bash /tmp/feat.sh
root 17 1 0 01:23 ? 00:00:00 /bin/bash /tmp/bar
root 18 17 99 01:23 ? 00:06:13 [java]
root 28 0 0 01:23 ? 00:00:00 sh
root 40 28 0 01:29 ? 00:00:00 ps -ef