Bug #67181 [Opn->Csd]: Event port code needs to reassociate to port after an event

From: Date: Tue, 07 Dec 2021 22:14:02 +0000
Subject: Bug #67181 [Opn->Csd]: Event port code needs to reassociate to port after an event
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238272@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67181&edit=1 ID: 67181 Updated by: bukka@php.net Reported by: d dot v dot taylor at leedsmet dot ac dot uk Summary: Event port code needs to reassociate to port after an event -Status: Open +Status: Closed Type: Bug Package: FPM related Operating System: Solaris 11.1 PHP Version: 5.5.12 -Assigned To: +Assigned To: bukka Block user comment: N Private report: N New Comment: This has been fixed by https://github.com/php/php-src/pull/6913 so it's available in 7.4+ Previous Comments: ------------------------------------------------------------------------ [2015-09-20 08:37:49] rainer dot jung at kippdata dot de Please check the latest patch at https://bugs.php.net/bug.php?id=65800 I expect your problem to be a dublicate. ------------------------------------------------------------------------ [2014-07-08 14:47:04] d dot v dot taylor at leedsmet dot ac dot uk From a quick read, the patch attached to bug #65800 puts this re-association in. ------------------------------------------------------------------------ [2014-05-02 15:34:38] d dot v dot taylor at leedsmet dot ac dot uk Description: ------------ I've enabled request_slowlog_timeout on PHP-FPM, but it only seems to successfully act on the first request. Subsequent slow requests cause child processes to be sent the SIGSTOP but they *don't* then get traced and SIGCONT-ed, leaving them in a stopped state indefinitely. I've investigated this and it looks like the problem is connected to the port event module. This is a section of the port_associate man page: When an event for a PORT_SOURCE_FD object is retrieved, the object no longer has an association with the port. The event can be processed without the possibility that another thread can retrieve a subsequent event for the same object. After processing of the file descriptor is completed, the port_associate() function can be called to reassociate the object with the port. i.e. if any events are successfully read from the port in fpm_event_port_wait(), it needs an explicit call to port_associate() again to re-establish the association and ensure future events are listened for. At the moment this doesn't happen, and so the parent FPM process doesn't see the subsequent port events caused by child processes being stopped. The problem doesn't occur if I switch to using /dev/poll for the event mechanism. Test script: --------------- <?php /* Set e.g. request_slowlog_timeout = 5 */ sleep(10); phpinfo(); ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67181&edit=1

« previous php.bugs (#238272) next »