|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59261 A starvation of gearman handle process
Submitted: 2010-06-15 02:52 UTC Modified: 2011-08-20 07:43 UTC
From: dr4k0n at list dot ru Assigned:
Status: No Feedback Package: gearman (PECL)
PHP Version: 5.2.13 OS: Gentoo Linux 2.6.31-xenU-fly
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-06-15 02:52 UTC] dr4k0n at list dot ru
I have a problem with gearman handle process. Sometime it starve and
doing nothing.
I work with gearman from PHP. System configuration: Gentoo Linux,
php-5.2.13, pecl-gearman-0.7.0, gearmand-0.12.
In my scripts main process create workekrs (other php scripts) through
proc_open and create tasks. Main process have sigint handler and when
it starve, event this handler not work.

When it's happened, all worker processes in 'SN' linux state:

drakon # ps ax | grep php
22069 pts/1    S+     0:00 grep --colour=auto php
22964 ?        SN     0:00 /usr/bin/php -f /var/www/ cron per_minute
22977 ?        SN     0:22 /usr/bin/php -f /var/www/ gearman_worker_advance
22978 ?        SN     0:31 /usr/bin/php -f /var/www/ gearman_worker_advance
22979 ?        SN     0:29 /usr/bin/php -f /var/www/ gearman_worker_advance
22980 ?        SN     0:33 /usr/bin/php -f /var/www/ gearman_worker_advance
22981 ?        SN     0:30 /usr/bin/php -f /var/www/ gearman_worker_advance
22982 ?        SN     0:20 /usr/bin/php -f /var/www/ gearman_worker_advance
22983 ?        SN     0:24 /usr/bin/php -f /var/www/ gearman_worker_advance

S = Interruptible sleep (waiting for an event to complete)
N = low-priority (nice to other users)

I write output stream of all workers to files and in all files I see phrase '[g_advance_url] finished' that means that task finished.
Status of gearman in this moment:

drakon # telnet 4730
Connected to
Escape character is '^]'.
sync_url	0	0	0
finish	0	0	7
advance_url	0	0	7

It's means that all tasks finished. But in logs I see that process "cli.php cron per_minute" created 225 tasks and only 131 of them have completed.

I think it looks like the problems in PECL module.

Reproduce code:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-15 02:55 UTC] dr4k0n at list dot ru
Code link:
 [2011-05-15 03:42 UTC]
The following code works fine for me:

If you want me to try and fix this, I need a more concise example and some example data.
 [2011-08-20 07:43 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 30 19:01:25 2023 UTC