Bug #78469 [PATCH]: FastCGI on_accept hook is not called when using named pipes on Windows
| From: | turchanov@farpost.com | Date: | Wed, 28 Aug 2019 03:32:08 +0000 |
| Subject: | Bug #78469 [PATCH]: FastCGI on_accept hook is not called when using named pipes on Windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222462@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78469&edit=1
ID: 78469
Patch added by: turchanov@farpost.com
Reported by: turchanov at farpost dot com
Summary: FastCGI on_accept hook is not called when using
named pipes on Windows
Status: Open
Type: Bug
Package: FPM related
Operating System: Linux
PHP Version: 7.3.8
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #78469: fcgi_accept_request must call on_accept hook for named pipes too
On GitHub: https://github.com/php/php-src/pull/4636
Patch: https://github.com/php/php-src/pull/4636.patch
Previous Comments:
------------------------------------------------------------------------
[2019-08-28 02:59:48] turchanov at farpost dot com
Description:
------------
fcgi_accept_request function is supposed to call a FastCGI implementation's on_accept hook when
entering an "accepting" stage (that is right before calling "accept"). This hook
implementation (fpm_request_accepting) updates a worker state to an "accepting" state
which is effectively an "Idle" state, and updates counters on the scoreboard of the
corresponding pool (idle++, active--).
But this is not done when listening for client connections on a named pipe on Windows platform. In
that case a combination of ConnectNamedPipe/WaitForSingleObject is used (to be able to catch
in_shutdown as far as I understand), but it is nonetheless functionally equivalent to
"accept" call. Also by not calling on_hook neither a worker's state is updated to
"accepting" state nor scoreboard counters are updated.
So I suggest calling on_accept hook regardless of "named pipe" vs "tcp/unix
socket".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78469&edit=1