php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59071 GearmanClient::echo does not return on success
Submitted: 2010-02-10 13:40 UTC Modified: 2010-02-11 13:52 UTC
From: rubi at metacafe dot com Assigned:
Status: Closed Package: gearman (PECL)
PHP Version: 5.3.0 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 + 45 = ?
Subscribe to this entry?

 
 [2010-02-10 13:40 UTC] rubi at metacafe dot com
Description:
------------
When calling GearmanClient::echo, the function does not return 
if the server is responding correctly.

In the bellow example, in case gearmand is up and listening, 
only "AddServer: 1" is presented and the script is stuck.
If the gearmand server is down, an error is returned 
immediately.

With a gearmand running on a remote CentOS server the problem 
is not being reproduced, and echo returns immediately at any 
case. 

Reproduce code:
---------------
$client= new GearmanClient();
echo "\nAddServer: ".$client->addServer('localhost', 4730);
$echostr = serialize(array('arbitrary'=>'correct'));
$echoret = $client->echo($echostr);
echo "\nEcho: $echoret";


Expected result:
----------------
echo() should return.

Actual result:
--------------
This is an strace output of gearmand when performing the 
echo:

epoll_wait(3, {{EPOLLIN, {u32=6, u64=6}}}, 1023, 4294967295) 
= 1
accept(6, {sa_family=AF_INET, sin_port=htons(57740), 
sin_addr=inet_addr("127.0.0.1")}, [14748492982327967760]) = 
11
write(1, " INFO Accepted connection from 1"..., 47 INFO 
Accepted connection from 127.0.0.1:57740
) = 47
setsockopt(11, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(11, SOL_SOCKET, SO_LINGER, {onoff=1, linger=10}, 
8) = 0
setsockopt(11, SOL_SOCKET, SO_SNDTIMEO, 
"\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
setsockopt(11, SOL_SOCKET, SO_RCVTIMEO, 
"\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
setsockopt(11, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0
setsockopt(11, SOL_SOCKET, SO_RCVBUF, [32768], 4) = 0
fcntl(11, F_GETFL)                      = 0x2 (flags O_RDWR)
fcntl(11, F_SETFL, O_RDWR|O_NONBLOCK)   = 0
epoll_ctl(3, EPOLL_CTL_ADD, 11, {EPOLLIN, {u32=11, u64=11}}) 
= 0
write(1, "CRAZY [   0]       127.0.0.1:577"..., 53CRAZY [   
0]       127.0.0.1:57740 Watching  POLLIN 
) = 53
write(1, " INFO [   0]       127.0.0.1:577"..., 45 INFO [   
0]       127.0.0.1:57740 Connected
) = 45
epoll_wait(3, 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-11 13:52 UTC] rubi at metacafe dot com
It appears that there's a local problem with using 
'localhost', though it might be a gearman issue. Until it's 
being verified I'm closing the bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC