-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Throw an exception from Celery retry() #8905
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
Conversation
Without an exception here, or handling the return from `_check_concurrency_limit`, a build that hits a concurrency limit in this method will both set a retry on the task, but will also continue processing the current task like normal. This results in two identical builds, then three, then four, and so on. Untested what this does to the UI though.
cc @humitos as you might have more background on why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is just copied from before, where we were not handling exceptions nicely, and were explicitly returning False
after this line.
This looks good for now as a quick fix and it seems that solved the problem, so 🎉 However, I just wanted to note here that I need to check a little deeper the workflow to understand what's going on:
I'm happy merging this, but I want to come back here and do some tests to understand exactly what's happening so we can document it properly and execute the exact code we want for each case. |
Also, I saw that there is still a problem with the concurrency limit still: https://sentry.io/organizations/read-the-docs/issues/2998694596/ that I want to come back and double check. |
Ahh yeah good catch, looks like this PR isn't the only fix we need here. Shall we merge this so it's not sitting around hotfix, and move the remaining pieces to a separate issue? |
Yes. I'm merging this PR. The test issue seems unrelated. |
It goes to
This works perfectly. However, to make usage of this attribute we need to I'm opening a PR with these changes to make usage of these Celery features. |
Without an exception here, or handling the return from
_check_concurrency_limit
, a build that hits a concurrency limit inthis method will both set a retry on the task, but will also continue
processing the current task like normal. This results in two identical
builds, then three, then four, and so on.
Untested what this does to the UI though. Edit: the UI reports the retry as I'd expect 👍