Edit report at https://bugs.php.net/bug.php?id=60961&edit=1
ID: 60961
Comment by: ingo dot bez at gmx dot de
Reported by: phpbugs at oops dot mooo dot com
Summary: Graceful Restart (USR2) isn't very graceful
Status: Open
Type: Bug
Package: FPM related
Operating System: Debian Squeeze
PHP Version: 7.0
Block user comment: N
Private report: N
New Comment:
May I ask carefully if and when this problem will be solved?
Seven years open, a patch functional since the beginning of 2017 and public for 11 months now...
Wow.
Previous Comments:
------------------------------------------------------------------------
[2019-10-03 11:43:01] mike@php.net
The following pull request has been associated:
Patch Name: php-fpm: graceful restart without blocking/losing requests
On GitHub: https://github.com/php/php-src/pull/3758
Patch: https://github.com/php/php-src/pull/3758.patch
------------------------------------------------------------------------
[2018-08-23 15:33:04] danny dot kopping at hetzner dot co dot za
Hi
We have been experiencing this issue for a while, and after some investigation - we think we have
isolated the issue.
This is how we understand it:
When FPM receives a USR2 signal, it attempts to wait for its children to finish processing, and then
sends a QUIT signal to each child. If a child does not respond in the amount of time defined in
"process_control_timeout" then the master process sends a TERM.
Now, while FPM is waiting for its children to terminate, it goes into a "reloading" state,
it would seem. It prints the message "Reloading in progress ..." to its log. During this
time, one can send as many USR2 signals to the master process as one likes - it will not cause any
problems. However, if one sends a USR2 signal after the
execvp("/usr/sbin/php-fpm7.1", {"/usr/sbin/php-fpm7.1",
"--nodaemonize", "--fpm-config",
"/etc/php/7.1/fpm/php-fpm.conf"}) syscall and before receiving the "fpm is
running, pid xxx" log entry - then it will crash the master process and consequently all the
children.
Our suspicion is that the signal handling is buggy between startup time and moving into the
"ready to accept connections" state (without looking at the source).
------------------------------------------------------------------------
[2018-07-01 08:35:49] i at xstudio dot me
mark!
------------------------------------------------------------------------
[2017-11-30 17:17:14] federico dot omoto at gmail dot com
And this is also affecting the recently released PHP 7.2.0.
Is this bug expected to be fixed in the short term?
------------------------------------------------------------------------
[2017-10-21 16:11:04] luke at viovet dot co dot uk
This is also affecting PHP 7.1 on Ubuntu 14.04 and 16.04. Please fix asap.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=60961
--
Edit this bug report at https://bugs.php.net/bug.php?id=60961&edit=1