php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59519 multiple server Failover doesn't work
Submitted: 2010-11-19 16:42 UTC Modified: 2017-01-10 08:22 UTC
Votes:6
Avg. Score:4.8 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:0 (0.0%)
From: bluespire at gmail dot com Assigned:
Status: Suspended Package: gearman (PECL)
PHP Version: 5.2.11 OS: FreeBSD 7.0
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: bluespire at gmail dot com
New email:
PHP Version: OS:

 

 [2010-11-19 16:42 UTC] bluespire at gmail dot com
Description:
------------
If you have 2 or more Gearman servers, when one goes down 
the client failover doesn't work and you get the following 
error:

 gearman_connection_flush:lost connection to server (32).

I have additional observations about this:

1)  The order in which you add servers determines which 
server is ignored.  It appears that the server that must not 
go down is the last of 2 servers.
2)  Try this:   if you addServer() A and then B servers, 
then shut down gearmand on server A everything works fine.  
Shut down gearmand on server B and you get the error.

Others have reported this bug here:

https://answers.launchpad.net/gearmand/+question/112134

Reproduce code:
---------------
$gearman->addServer('192.168.0.1');
$gearman->addServer('192.168.0.2');
$job_handle[]= $gearman->doBackground("do_code", serialize($data));
if ($gearman->returnCode() != GEARMAN_SUCCESS) {
  $error = $gearman->error();
}

Expected result:
----------------
When you take down either server, the client should failover 
to sending jobs to the other server.  This is only true as 
long as you take down only the first server added by 
addServer().





Actual result:
--------------
In the sample code, if you take down gearman on 192.168.0.1 
the doBackground call will continue to succeed. If you only 
take down 192.168.0.2 then you will get : 

gearman_connection_flush:lost connection to server (32)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-15 10:59 UTC] hradtke@php.net
I will take a look, but it might be an issue with libgearman itself.
 [2017-01-10 08:22 UTC] kalle@php.net
-Status: Assigned +Status: Suspended -Assigned To: hradtke +Assigned To:
 [2017-01-10 08:22 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-2021 The PHP Group
All rights reserved.
Last updated: Fri Dec 03 01:03:42 2021 UTC