cli mode. The
master process exits and restarts the child process through the SIGCHLD listening child process.
swoole_process::signal(SIGCHLD, function(){
//
while ($ret = swoole_process::wait(false)) {
unset(self::$wokers[$ret["pid"]]);
self::logError("SIGNAL-WORKER_EXIT-%s", $ret["pid"]);
//
self::initProcess();
}
});
directly kill the child process, and the parent process can receive the signal and pull the child process again.
when fatal occurs in the child process, the parent process does not receive the signal that the child process exits, and the child process becomes a zombie process.
[php] <defunct>
would like to ask all the bosses have encountered this kind of situation? When pcntl is implemented, when the child process fatal, the parent process is subject to SIGCHLD.