Closed weiiwang01 closed 4 months ago
Thanks @weiiwang01, especially for the code change suggestion. I believe this is a duplicate of #163. Can you please confirm, and if so, close this and copy your comments/suggestion there?
Yes, sorry for the duplicate issue.
When the pebble daemon is in the process of executing a command and receives a
SIGTERM
signal, it hangs rather than shutting down gracefully.To reproduce this problem:
I think this happens because the
reaper.Stop
function stops the reaper loop without terminating and waiting for all child processes to finish and be reaped. This causes tasks likeexec
relying onreaper.WaitCommand
to wait forever, as they depend on the reaper loop to send the process's exit code to proceed.I created a patch to kill all child process managed by the reaper and wait for them to exit, which seems to fix this issue.