You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chains with unregistered tasks fail to call callbacks (send_task bug) #1522
In task.py, the call is correct, errbacks and callbacks are specified:
494: task_id = P.publish_task(self.name, args, kwargs,
495: task_id=task_id,
496: callbacks=maybe_list(link),
497: errbacks=maybe_list(link_error),
498: reply_to=reply_to or self.app.oid,
499: **options)
In base.py callbacks/errbacks are not set:
294: return result_cls(producer.publish_task(
295: name, args, kwargs,
296: task_id=task_id,
297: countdown=countdown, eta=eta,
298: expires=expires, **options
299: ))
A fix is to add callbacks=options.get('link'), on line 298 of the above.
This is a serious issue. It means that the remainder of chains of length >= 3 subtasks fail to run. When fixing this, please also take a look at other areas where changes might not have been propagated correctly across the base.py/task.py split.
This is not what happens here, the length of the chain does not matter. What happens is that subtasks for tasks that are not registered falls back to using send_task, and send_task does not honor the link/link_error arguments properly.
I will release 3.0.23 tomorrow with this fix in it (Friday is our release day)
Also, I have been meaning to refactor the separate send_task/apply_async methods for some time now, it has often resulted in bugs but there are some challenges in merging them.
I see. We are using different classes of celery workers (say, windows and Linux). They don't register the same sets of tasks, but we run a chain that crosses worker types. That way a file can be processed in a pipeline across different hardware.
One issue we had to work around was having to import our module just to call a task by reference. This meant we had to do dynamic imports when the called task depended on windows-only imports, for example.
We could use send_task with "call by name", but it would be nice to have a "shallow import" function that pulls in @task defs but nothing else, perhaps using python introspection. Another option would be to pre-parse defs into a rpc client stub of just task prototypes, but that isn't as good.
Thanks for the response and quick fix.
-Nate
On Aug 29, 2013, at 5:26 AM, Ask Solem Hoel [email protected] wrote:
This is not what happens here, the length of the chain does not matter. What happens is that subtasks for tasks that are not registered falls back to using send_task, and send_task does not honor the link/link_error arguments properly.
The fix is in master and 3.0 branches!
—
Reply to this email directly or view it on GitHub.
Activity
natecode commentedon Aug 27, 2013
This is a serious issue. It means that the remainder of chains of length >= 3 subtasks fail to run. When fixing this, please also take a look at other areas where changes might not have been propagated correctly across the base.py/task.py split.
ask commentedon Aug 29, 2013
This is not what happens here, the length of the chain does not matter. What happens is that subtasks for tasks that are not registered falls back to using
send_task, andsend_taskdoes not honor thelink/link_errorarguments properly.The fix is in master and 3.0 branches!
ask commentedon Aug 29, 2013
I will release 3.0.23 tomorrow with this fix in it (Friday is our release day)
Also, I have been meaning to refactor the separate send_task/apply_async methods for some time now, it has often resulted in bugs but there are some challenges in merging them.
natecode commentedon Aug 29, 2013
I see. We are using different classes of celery workers (say, windows and Linux). They don't register the same sets of tasks, but we run a chain that crosses worker types. That way a file can be processed in a pipeline across different hardware.
One issue we had to work around was having to import our module just to call a task by reference. This meant we had to do dynamic imports when the called task depended on windows-only imports, for example.
We could use send_task with "call by name", but it would be nice to have a "shallow import" function that pulls in @task defs but nothing else, perhaps using python introspection. Another option would be to pre-parse defs into a rpc client stub of just task prototypes, but that isn't as good.
Thanks for the response and quick fix.
-Nate
On Aug 29, 2013, at 5:26 AM, Ask Solem Hoel [email protected] wrote: