#36158 [Asn->Csd]: SIGTERM is not handled correctly when running as a FastCGI server
| From: | dmitry@php.net | Date: | Fri, 03 Feb 2006 16:32:58 +0000 |
| Subject: | #36158 [Asn->Csd]: SIGTERM is not handled correctly when running as a FastCGI server | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92874@lists.php.net to get a copy of this message | ||
ID: 36158
Updated by: dmitry@php.net
Reported By: chris at mysociety dot org
-Status: Assigned
+Status: Closed
Bug Type: CGI related
Operating System: *
PHP Version: 5.1.2, 4.4.2
Assigned To: dmitry
New Comment:
The bug is fixed in CVS HEAD and PHP_5_1 with libfcgi replacement,
however mod_fcgi can lose some requsts during graceful restart itself.
Previous Comments:
------------------------------------------------------------------------
[2006-02-02 00:48:49] chris at mysociety dot org
Yeah, that's a fair point. Matters would be improved by adding the
FCGI_FAIL_ON_INTR flag to the call to FCGX_InitRequest; that's not a
complete solution, since that might cause the server process to quit on
receipt of another signal in the call to FCGX_Accept_r, but that's not a
very serious problem. Here's a patch that includes that change:
http://bitter.ukcod.org.uk/~chris/tmp/20060201/php-4.3.10-fastcgi-sigterm-fix.patch
------------------------------------------------------------------------
[2006-02-01 18:20:43] stefan at luli dot de
Hi there,
I am struggeling with the described problem for quite some time now. I
have traced the problem now in the code back to
the SIGTERM play between fcgi_pm and php.
The question is if fcgi_pm should send a SIGTERM to the script even
though it processes a request at this momment. One would think that
fcgi_pm should be smart enough to deal with this situation (wait until
request is done/send no more requests/send SIGTERM). But apparently it
isn't.
The patch seams to do the trick, but is also prevents php to terminate
in case it's just idel. So php will sit there until the next request
comes in and terminate once the request is done before waiting for the
next request to come in. This should be solved.
------------------------------------------------------------------------
[2006-01-26 08:58:25] sniper@php.net
Dmitry, does the new code fix this problem..?
------------------------------------------------------------------------
[2006-01-26 01:55:15] chris at mysociety dot org
That snapshot (a) doesn't fix the problem -- the FastCGI code is
essentially unchanged since 4.x, though with a bunch of whitespace
noise; and (b) wouldn't help us in any case since it's PHP5 and our
applications are written for PHP4.
------------------------------------------------------------------------
[2006-01-25 23:51:05] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
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
http://bugs.php.net/36158
--
Edit this bug report at http://bugs.php.net/?id=36158&edit=1