Edit report at https://bugs.php.net/bug.php?id=60961&edit=1
ID: 60961
Comment by: razvanphp at yahoo dot com
Reported by: phpbugs at oops dot mooo dot com
Summary: Graceful Restart (USR2) isn't very graceful
Status: Assigned
Type: Bug
Package: FPM related
Operating System: Debian Squeeze
PHP Version: 5.3.9
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
I have the same problem with PHP 5.4.39-0+deb7u2, latest Debian Wheezy.
Nginx mainline 1.9 uses unix socket connection to php-fpm, but it results in 502 when reloading
php-fpm service.
Found this in the code, that seems to cause this:
static void sig_soft_quit(int signo) /* {{{ */
{
int saved_errno = errno;
/* closing fastcgi listening socket will force fcgi_accept() exit immediately */
close(0);
if (0 > socket(AF_UNIX, SOCK_STREAM, 0)) {
zlog(ZLOG_WARNING, "failed to create a new socket");
}
fpm_php_soft_quit();
errno = saved_errno;
}
Previous Comments:
------------------------------------------------------------------------
[2014-07-24 11:29:59] yinchuan at baixing dot com
CentOS 6.5 + Nginx 1.4.7 + PHP 5.4.9 with php-fpm
"fastcgi_keep_conn on;" in nginx.conf
set pm.max_request=100, then when thd 100th reqest reach, php process exit, and nginx log
error:"... recv() failed (104: Connection reset by peer) while reading response header from
upstream, client: XXX"
when set "fastcgi_keep_conn off;", everything is ok.
------------------------------------------------------------------------
[2014-02-19 19:35:47] ptr dot wang at gmail dot com
php5-fpm 5.5.8+dfsg-3+sury.org~precise+2 on ubuntu precise has the same problem.
killing USR2 signal to php5-fpm master process causes all php5-fpm processes (include the master
process) replaced, and the active requests end up with HTTP 502 Bad gateway error on the nginx side.
------------------------------------------------------------------------
[2013-09-18 16:22:53] baohx2000 at gmail dot com
Having this issue on 5.5.3. Sending USR2 to master process kills the master and
orphans the children. Have to then kill all children before I can restart the
master process.
------------------------------------------------------------------------
[2013-02-13 15:57:49] phpbugs at oops dot mooo dot com
Try setting process_control_timeout to something higher than 0.
------------------------------------------------------------------------
[2013-02-13 09:47:32] php-bugs at puzzled dot xs4all dot nl
CentOS 6.3 with php-5.3.3 and the FPM code from 5.3.20 still has the same issue. FWIW this makes it
challenging to use nginx with php-fpm because it results in a 502 Bad Gateway. I'm more than
happy to help testing a patch.
------------------------------------------------------------------------
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