php.net |  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
 [2010-06-15 02:52 UTC] dr4k0n at list dot ru
Description:
------------
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/infoskidka.ru/www/cli.php cron per_minute
22977 ?        SN     0:22 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22978 ?        SN     0:31 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22979 ?        SN     0:29 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22980 ?        SN     0:33 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22981 ?        SN     0:30 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22982 ?        SN     0:20 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php gearman_worker_advance
22983 ?        SN     0:24 /usr/bin/php -f /var/www/infoskidka.ru/www/cli.php 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 127.0.0.1 4730
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
status
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:
---------------
Code: http://groups.google.com/group/gearman/browse_thread/thread/be8a2887caa82576?pli=1



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-15 02:55 UTC] dr4k0n at list dot ru
Code link: http://groups.google.com/group/gearman/browse_thread/thread/be8a2887caa82576?pli=1
 [2011-05-15 03:42 UTC] hradtke@php.net
The following code works fine for me: http://pastebin.com/tAbzFsqW

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] hradtke@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 11:01:28 2024 UTC