|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

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

 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:

Reproduce code:
$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 

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

gearman_connection_flush:lost connection to server (32)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-15 10:59 UTC]
I will take a look, but it might be an issue with libgearman itself.
 [2017-01-10 08:22 UTC]
-Status: Assigned +Status: Suspended -Assigned To: hradtke +Assigned To:
 [2017-01-10 08:22 UTC]
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: Sat Apr 20 08:01:30 2024 UTC