php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61840 Worker exits with GearmanWorker::work(): flush(Broken pipe) on completion
Submitted: 2012-04-24 15:25 UTC Modified: 2013-02-18 00:35 UTC
From: russ at eatmymonkeydust dot com Assigned: hradtke (profile)
Status: No Feedback Package: gearman (PECL)
PHP Version: 5.3.10 OS: Ubuntu 10.04.4 LTS (Lucid)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: russ at eatmymonkeydust dot com
New email:
PHP Version: OS:

 

 [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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-25 00:44 UTC] hradtke@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: hradtke
 [2012-04-25 01:43 UTC] hradtke@php.net
I setup a simple worker that does nothing and a client that sends 5 tasks to the 
worker. I cannot reproduce. Can you please provide a simple worker script that 
causes this?
 [2012-04-25 01:43 UTC] hradtke@php.net
-Status: Assigned +Status: Feedback
 [2012-12-04 17:34 UTC] crontab at codehaven dot net
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());
	}
}
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC