IPv6 Client / Worker

Bug #1118751 reported by Sammie S. Taunton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
New
Undecided
Unassigned

Bug Description

Been using Gearman for a while now, so it's nothing new... However I just noted my Client / Workers are not talking to each other when using IPv6 addresses. So as a test I setup the examples found here -> http://www.php.net/manual/en/gearman.examples-reverse.php

I have 2 machines, same network, sitting next to each other. I can confirm each server can see each other.... ping, etc.. all work.

I changed the addServer on both machines to:

$gmclient->addServer('[FD35:4776:6804:2:7::1]', 4730);

I also tried

$gmclient->addServer('FD35:4776:6804:2:7::1', 4730);

Gearman is running on both machines and I am accepting connections on all IP's

When I start the worker I'm getting the expected Waiting for job...

On the client I'm getting:
Sending job
RET: 13

So as another test I setup an IPv4 network and redid the tests, only changing the addServer to addServer('10.3.1.1', 4730)
Restarted the worker and tried the client, it worked! But the problem here is that we don't use any IPv4 addresses, we are strictly on an IPv6 network

I can confirm if I run both Client / Worker on the same machine and set the addServer to ::1, it works too.

The only errors I do see in the php_error_log are the following:

When I set the IPv6 to have [ ] around it I see this:

[07-Feb-2013 15:09:57 America/Chicago] PHP Warning: GearmanClient::addServer(): gearman_connection_create_args(GEARMAN_GETADDRINFO) -> libgearman/connection.cc:211 in /root/client.php on line 5

[07-Feb-2013 15:09:57 America/Chicago] PHP Warning: GearmanClient::doNormal(): _client_do(GEARMAN_NO_SERVERS) occured during gearman_client_run_tasks() -> libgearman/client.cc:154 in /root/client.php on line 17

Without using the [ ] around the IPv6 address I'm getting an exception stack trace:

Stack trace:
#0 /root/client.php(6): GearmanClient->addServer('FD35:4776:6804:...', 4730)
#1 {main}
  thrown in /root/client.php on line 6

On line 6:
$gmclient->addServer('FD35:4776:6804:2:7::1', 4730);

PHP is built with IPv6 support, all other IPv6 related services are running as expected, only gearman seems to be having an issue.

If there is anything further I can supply please let me know and I'll get the details.

Revision history for this message
Sammie S. Taunton (diemuzi) wrote :

Sorry I should of added I'm using:

PHP 5.4.11
Gearman C Client 1.1.4
Gearman PHP Extension 1.1.1

Archlinux

Revision history for this message
Sammie S. Taunton (diemuzi) wrote :

After upgrading the Gearman C Client to 1.1.5 I'm not getting the following from the Client:

Sending job
RET: 14

[07-Feb-2013 17:15:09 America/Chicago] PHP Warning: GearmanClient::doNormal(): _client_do(GEARMAN_LOST_CONNECTION) occured during gearman_client_run_tasks() -> libgearman/client.cc:154 in /root/client.php on line 17

Revision history for this message
Brian Aker (brianaker) wrote :

(Sorry, just now gettign around to reading this.)

Revision history for this message
peterfirst (peterfirst) wrote :

Solved the connection problem as follows:

$servers = ["gearman1.local", "gearman2.local"];

$serversAdded = 0;

foreach ( $servers as $server ) {
    $serversAdded += (int) GermanClient::addServers($server)
}

if ( $server < 1 ){
        error_log("Can't add one or more servers to gearman client");
       // throw exception or handle the case
}

Note:
1. GearmanClient::addServer() will only add it to list and not validate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.