php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59848 Server-side callbacks not working for background tasks
Submitted: 2011-07-13 12:10 UTC Modified: 2011-07-14 00:03 UTC
From: dev at bottomlessinc dot com Assigned: hradtke (profile)
Status: Wont fix Package: gearman (PECL)
PHP Version: 5.3.3 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dev at bottomlessinc dot com
New email:
PHP Version: OS:

 

 [2011-07-13 12:10 UTC] dev at bottomlessinc dot com
Description:
------------
Client doesn't receive data/status from workers when jobs 
are run in 
the background.

This was already mentioned by Rasmus back in 2009:
http://toys.lerdorf.com/archives/51-Playing-with-
Gearman.html

quote:
"I only use non-blocking background tasks and it currently 
isn't 
possible to use this data passing mechanism from a 
background task. 
Right now if you call $job->data() from a background worker, 
the 
data is simply dropped."

(see the 2 last paragraphs)

What's the status?

Is the problem with the Gearman server? or only the Pecl 
extensions?

Reproduce code:
---------------
On the client:

Register callbacks:
setDataCallback()
setStatusCallBack()

Add bg tasks:
addTaskBackground()
runTasks()

On the Worker:
sendData()
sendStatus()

Expected result:
----------------
When the worker calls sendData/sendStatus, the corresponding 
registered callbacks on the Client should be called

Actual result:
--------------
Callbacks not called, data dropped.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-14 00:03 UTC] hradtke@php.net
Once a client sends a background task, the client is no longer registered as listening on the gearman daemon. When the worker sends the data back, it goes to the daemon, the daemon concludes no one is listening and drops the data.

When PHP makes an asynchronous request, it fires and forgets. It does not work like JavaScript.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC