You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to know in the parent process if the state of the child process changes?
I'm trying to spawn "sh -c 'sleep 60'", then kill this child process with kill -9 from the shell and this child process starts to be in the defunct state until parent process exits. At the same time no notifications received within NuProcessHandler#onExit.
Kind Regards,
Sergey
The text was updated successfully, but these errors were encountered:
When you spawn sh -c 'sleep 60' you are actually spawning a shell, that spawns a sleep 60.
If you kill the shell using kill, kill -9 or process.destroy(..) then only the shell is killed, while the sleep continues to live. It is reparented to some parent (usually your shell or PID 1), but still blocks the shell from finishing and it stays in defunct or zombie state.
process.waitFor(..) will also block, as long as the shell is not completely gone.
If you also kill the sleep 60 or just wait until it dies on its own, process.waitFor(..) will return and NuProcessHandler#onExit is executed.
See also #78 for a request to delete all child processes, so you can avoid this situation.
Hello,
Is it possible to know in the parent process if the state of the child process changes?
I'm trying to spawn "sh -c 'sleep 60'", then kill this child process with kill -9 from the shell and this child process starts to be in the defunct state until parent process exits. At the same time no notifications received within NuProcessHandler#onExit.
Kind Regards,
Sergey
The text was updated successfully, but these errors were encountered: