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 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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 23 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 18:01:28 2024 UTC