1

What happens when a Celery task within a chain fails?

When the failed task is retried with success, does it simply resume from where it was within a chain?

For example:

my_chain = (task1.s() | task2.s() | task3.s())
my_chain.apply_async((**params))

If task2 fails and retried with success, would task3 then be executed?

There is an old question that touches on the subject (Retrying celery failed tasks that are part of a chain), and a Github issue and commit applied to version 3.0.4 of Celery that makes Task.retry forward the chain links to remedy this issue. However, I am unable to find any concrete documentation that explains behavior of Celery during this situation.

Definitely, no mention of it within the Celery documentation Retrying sections (http://celery.readthedocs.org/en/latest/userguide/tasks.html#retrying, http://celery.readthedocs.org/en/latest/reference/celery.app.task.html#celery.app.task.Task.retry)

2
  • 1
    If task2 succeeds after a task2.retry() call task3 will get executed. Commented Mar 2, 2015 at 13:59
  • Is there any documentation on this? Commented Mar 2, 2015 at 16:07

1 Answer 1

2

I believe the following snippet is the closest thing to describing this.

"When you call retry it will send a new message, using the same task-id, and it will take care to make sure the message is delivered to the same queue as the originating task.

When a task is retried this is also recorded as a task state, so that you can track the progress of the task using the result instance (see States)."

I believe where it state that the task state is tracked best describes what you are looking for.

I also know this based on first hand experience

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.