|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
27 + 25 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 06:03:37 2023 UTC