|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-24 15:25 UTC] russ at eatmymonkeydust dot com
Description:
------------
The gearman-developers ppa recently updated gearman to 0.32 which forced us to rebuild pecl/gearman (1.0.2 at the time of this ticket).
Everything builds fine and tasks run but once the task completes the php process exits with the following warning:
PHP Warning: GearmanWorker::work(): flush(Broken pipe) lost connection to server during send -> libgearman/connection.cc:753 in /xxx/forkTask.class.php on line 60
Line 60 is a while($worker->work()) {} statement.
The first task completes, but then subsequent tasks are not "picked up" since the php process running this handler is killed.
Expected result:
----------------
No output, just continue the while loop and pick up the next worker
Actual result:
--------------
PHP Warning: GearmanWorker::work(): flush(Broken pipe) lost connection to server during send -> libgearman/connection.cc:753 in /xxx/forkTask.class.php on line 60
php process exits
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
I too have this problem. Code is below. Note that gearmand is being run on a remote server on the internet that is 12 hops away (31ms ping time). Appropriate firewall ports are open (otherwise the initial connection would fail, of course). PECL package gearman, version 1.0.2 stable. The d() function just echoes a timestamped string to the console. $gw = new GearmanWorker(); $gw->addServer("myserver.on.the.internet.com", 4730); $gw->addFunction("myfunc", "myfunc_fn"); while($gw->work()) { if ($gw->returnCode() != GEARMAN_SUCCESS) { d("Return code: ".$gw->returnCode()); } }