|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-11 13:52 UTC] rubi at metacafe dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
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,