|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-01-11 07:47 UTC] emayoral at arsys dot es
Description: ------------ I run a system with a relatively large number of pfp-fpm pools. Whenever a pool is added or removed a php-fpm reload is issued. The behaviour of php-fpm on reload is to terminate children with SIGQUIT, wait process_control_timeout (10 seconds in my config), then issue SIGTERM to the remaining children. Now, some of my pool children will not die on SIGQUIT when opcache is used, but that is a different bug. Point is until PHP 7.0, SIGTERM would finish the remaining children, the reload would complete in 10 seconds and everything would be fine. But starting with PHP 7.1 the php processes also handle SIGTERM (I suspect it uses the same signal handler as for SIGQUIT, although I am not 100% sure of that). Now the children which did not die on SIGQUIT do not die on SIGTERM either and the reload will not complete until those children are manually issued a SIGKILL. I think php-fpm 7.1 and higher should do its first round of SIGQUIT to its children on reload, but after process_control_timeout, issue a SIGKILL instead of a SIGTERM, since SIGTERM is not an effective way of ending rogue children any more. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 21:00:01 2025 UTC |
Digging further into the code, I think this case is covered in: sapi/fpm/fpm/fpm_process_ctl.c static void fpm_pctl_action_next() /* {{{ */ { int sig, timeout; if (!fpm_globals.running_children) { fpm_pctl_action_last(); } if (fpm_signal_sent == 0) { if (fpm_state == FPM_PCTL_STATE_TERMINATING) { sig = SIGTERM; } else { sig = SIGQUIT; } timeout = fpm_global_config.process_control_timeout; } else { if (fpm_signal_sent == SIGQUIT) { sig = SIGTERM; } else { sig = SIGKILL; } timeout = 1; } fpm_pctl_kill_all(sig); fpm_signal_sent = sig; fpm_pctl_timeout_set(timeout); } (Send SIGQUIT, wait process_control_timeout , send SIGTERM, wait 1 second, send SIGKILL) But my experience is that after the SIGQUIT and SIGTERM, the SIGKILL never happens (Which didn't matter until php 7.1 as SIGTERM would do the job). Not sure why, though.