|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61355 Gearman jobs are passed to more than one worker
Submitted: 2012-03-12 08:49 UTC Modified: 2013-02-18 00:35 UTC
From: info at tueena dot com Assigned: hradtke (profile)
Status: No Feedback Package: gearman (PECL)
PHP Version: 5.3.10 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: info at tueena dot com
New email:
PHP Version: OS:


 [2012-03-12 08:49 UTC] info at tueena dot com
Gearman jobs are passed to more than one worker if they throw and catch an exception in the way shown in the code below.

I have installed gearmand 0.27 and the pecl-package in version 1.0.2. It also appeared in version 1.0.1. I didn't test it in older versions.

Test script:
Please start geramand, put this code into a file and run it on cli:

The script needs write permissions in its folder (it writes a log file to pass the information between worker and client instance). You can also change the method doNormal() into doBackground(). In this case uncomment the sleep call.

Also try the run modes exception-sleep and standard (value of $sWorker in line 5). The error will not appear then.

I think you have to change some lines if you want to run this on Windows.

The script first checks if there are no "test" workers running and no "test" jobs in the queue. Then it starts 100 "test"-workers (same script called with a "worker" parameter). Then it runs 50 test jobs. The workers are writing their PID, the job handle and the random workload into a log file and after all jobs are done the client script analyses the log file and kills all workers.

Expected result:
The script should output "No job has been passed to more than one worker."

Actual result:
The script outputs "Those jobs has been passed more than one times to a worker" and a list of some jobs that have been passed two, three or even more times to a worker.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-20 09:40 UTC] info at tueena dot com
This bug also appeares in gearmand version 0.28.
 [2012-07-05 13:33 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: hradtke
 [2012-07-05 13:34 UTC]
-Status: Assigned +Status: Feedback
 [2012-07-05 13:34 UTC]
I just tested this script using gearman-0.33 and could not reproduce. Can you 
check that this is a problem with the latest libgearman?
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot 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-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 18:03:40 2021 UTC