php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59040 runTasks() fails to switch to second server, locks up.
Submitted: 2010-01-22 15:03 UTC Modified: 2017-01-10 08:21 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: peter dot urda at gmail dot com Assigned:
Status: Suspended Package: gearman (PECL)
PHP Version: 5.2.10 OS: Ubuntu Server 9.10 x86
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:
Package:
Bug Type:
Summary:
From: peter dot urda at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-22 15:03 UTC] peter dot urda at gmail dot com
Description:
------------
<?php

// -------------------------------------------------------------------
// START Basic Client Creatio

// Create Client
$client = new GearmanClient();
$client->addServer("192.168.10.58","4730");
$client->addServer("192.168.10.141","4730");

// END Basic Client Creation
// -------------------------------------------------------------------

// Start Tasks
$client->addTaskBackground("reverse", "ereh saw adrU");
$client->addTaskBackground("reverse", "!dlroW olleH");
$client->addTaskBackground("reverse", "ENO-F");
$client->addTaskBackground("reverse", "Hello out world!");

$client->addTaskHighBackground("reverse", "!!!YTIROIRP HGIH SI SIHT");
// above line 3 more times...

$client->addTaskLowBackground("reverse", "!!!ytiroirp wol si siht");
// above line 3 more times...

// code removed...
		
echo "Start Tasks!\n";
$client->runTasks();
// AT this point, if server 10.58 is DOWN,
// the script Locks up, and sends zero tasks to be Q'd in Server 2.
// Sometimes one random job makes it to the server, but that is it.
?> // end of script/program

Reproduce code:
---------------
http://pastebin.ca/1761938 (source  code)

http://pastebin.ca/1761941 (strace for failure, Server 10.58 is down, Server 10.141 is up but never gets the job)

http://pastebin.ca/1761942 (strace for Success, Server 10.58 is up, Server 10.141 is up. 10.58 gets all jobs, server 10.141 gets zero, which is correctly done)

Expected result:
----------------
Assuming Server #1 (10.58) is down, runTasks() should fire, send all the tasks to server #2, and finish running.

Actual result:
--------------
Script stops and hangs at runTasks(), and never finished. Job server #2 gets zero jobs.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-22 15:36 UTC] peter dot urda at gmail dot com
unseen SQL issue, investigation our end for now.
 [2010-01-25 12:28 UTC] peter dot urda at gmail dot com
More source code, more notes here:
http://groups.google.com/group/gearman/browse_thread/thread/6fd55e47b8059b8a

jleudke confirmed this as a bug on IRC  on 2010-01-25
 [2010-01-25 12:30 UTC] peter dot urda at gmail dot com
This also occurs if one uses addServers() for all situations...

* Adding by using a string which is built from a MySQL query.
* Adding by using variables imported from another PHP file
* Adding by manually typing out the IP's and Ports for servers.
 [2010-01-25 12:32 UTC] peter dot urda at gmail dot com
Google Groups Link appears to fail, here is a new shorter link:

http://bit.ly/7PTVzw
 [2017-01-10 08:21 UTC] kalle@php.net
-Status: Assigned +Status: Suspended -Assigned To: hradtke +Assigned To:
 [2017-01-10 08:21 UTC] kalle@php.net
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: Fri Apr 19 01:01:28 2024 UTC