php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68304 runTasks and sigint signal handler
Submitted: 2014-10-25 02:48 UTC Modified: 2017-01-10 08:24 UTC
From: ryan dot brothers at gmail dot com Assigned:
Status: Suspended Package: gearman (PECL)
PHP Version: 5.6.2 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-10-25 02:48 UTC] ryan dot brothers at gmail dot com
Description:
------------
I am running a gearman client script that runs a series of tasks in the foreground, but also has a pcntl_signal(SIGINT, ...) signal handler.  While the runTasks() call is running, I cannot press Control-C to exit the script.

For example, I am running the client example at http://php.net/manual/en/gearman.examples-reverse-task.php, except I added the following as the first line:

pcntl_signal(SIGINT, function() { echo 'sigint'; });

When I run this script, assuming no workers are available, I cannot press Control-C to exit the script.  I have to run kill -9 to end it.

Is there a way that I can use a SIGINT signal handler and still use runTasks() to run a series of parallel tasks over gearman in the foreground?

Alternatively, could runTasks() be changed to optionally throw an exception on a SIGINT rather than exiting the script?



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-25 02:59 UTC] ryan dot brothers at gmail dot com
Just to note, adding declare(ticks=1); to the example script has no effect either.  I still cannot press Control-C to exit the script.
 [2017-01-10 08:24 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-01-10 08:24 UTC] kalle@php.net
The gearman extension have not had much activity in the past few years, so I'm taking the safe bet that this is no longer under active development (as I don't consider the typo fixes on the github repo an active development), besides that it also targets unsupported PHP versions. Please unsuspend this report in case it begins to blossom with life once more
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC