php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78469 FastCGI on_accept hook is not called when using named pipes on Windows
Submitted: 2019-08-28 02:59 UTC Modified: -
From: turchanov at farpost dot com Assigned:
Status: Closed Package: FPM related
PHP Version: 7.3.8 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: turchanov at farpost dot com
New email:
PHP Version: OS:

 

 [2019-08-28 02:59 UTC] 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".



Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-28 03:32 UTC] turchanov at farpost dot com
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
 [2019-08-30 14:08 UTC] nikic@php.net
Automatic comment on behalf of turchanov@farpost.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8f564e5308970e3c1b96fd17e493c5c3a952954b
Log: Fixed bug #78469
 [2019-08-30 14:08 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC