-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batches task doesn't trigger next task in chain #26
Comments
Looks like we don't call into the chains (or groups) after a successful task run, this would need to port some of the code around https://github.com/celery/celery/blob/2411504f4164ac9acfa20007038d37591c6f57e5/celery/app/trace.py#L508-L516 This should be fairly easy to do and to add tests for. |
I'm trying to figure out how all of this works. Do I need to celery-batches/celery_batches/__init__.py Line 332 in f2ebd54
|
Another thing I don't understand is why do we need pickleable |
If you're trying to modify celery-batches, I think the thing to do is to take a look near: celery-batches/celery_batches/__init__.py Lines 177 to 179 in 99d06c2
Inside the else:
try:
for task_request in args[0]:
chain = task_request.chain
if chain:
...
else:
if success_receivers:
send_success(sender=task, result=result) But as you say below....this probably needs to not use
I was trying to remember this yesterday when looking at #24, I believe it gets pickled when you use prefork pool worker (or maybe it used to be pickled and is no longer in newer versions of Celery). |
Unfortunately it seems that batch tasks are also not passing their result to the next element in a chain. Next element only gets the return value of pseudo task, here's a minimal example:
|
By the way, second |
There's a bit of a fan-in/fan-out question here. It isn't always clear what the different chains mean:
So this might be trickier to solve than I first thought. |
I think of Batches like a control structure of sort - we keep our task DAG the same, but some tasks are executed together. So I see your cases like this:
|
I suppose that we can't implement that behavior using parent task, as we do now? |
You might be able to explicitly fire other tasks from the batch task, but that can cause issues if you're not careful (I can't seem to find the warning in the Celery docs at the moment...) It would probably be OK if you're using a separate queue for batch tasks (which I've found to be a good idea anyway, I should probably document that...) |
I'm trying to use celery-batches in chain, like this:
Celery never registers
task_bar
asbatch_task
child and the chain cuts off. What could be the cause and how can I fix it?The text was updated successfully, but these errors were encountered: