|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ryan dot brothers at gmail dot com
New email:
PHP Version: OS:


 [2014-10-25 02:48 UTC] ryan dot brothers at gmail dot com
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, 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?


Add a Patch

Pull Requests

Add a Pull Request


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]
-Status: Open +Status: Suspended
 [2017-01-10 08:24 UTC]
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: Sat Apr 13 22:01:28 2024 UTC