Fixing zombie process appearance and hang up on shutdown.
After the c8790d2a89bb commit, the SIGCHLD handler may return before processing all awaiting PIDs. To avoid zombie processes and ensure successful main process termination, waitpid() must be called until an error is returned. This closes #600 issue on GitHub.
This commit is contained in:
@@ -972,11 +972,13 @@ nxt_main_process_sigchld_handler(nxt_task_t *task, void *obj, void *data)
|
||||
|
||||
if (rt->nprocesses <= 1) {
|
||||
nxt_runtime_quit(task, 0);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
nxt_port_remove_notify_others(task, process);
|
||||
|
||||
nxt_queue_each(child, &children, nxt_process_t, link) {
|
||||
|
||||
Reference in New Issue
Block a user