Resolve Celery TaskObject Race Condition#4268
Merged
bjester merged 10 commits intolearningequality:unstablefrom Oct 30, 2023
Merged
Resolve Celery TaskObject Race Condition#4268bjester merged 10 commits intolearningequality:unstablefrom
bjester merged 10 commits intolearningequality:unstablefrom
Conversation
b77dd03 to
224a05c
Compare
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
|
|
||
| super_as_dict = TaskResult.as_dict | ||
|
|
||
| def as_dict(self): |
Member
There was a problem hiding this comment.
Could be worth checking if our own code calls this, as I overrode on TaskResult to add in the additional fields.
Member
There was a problem hiding this comment.
Edited my previous comment: missing the word 'code'. @ozer550 did you check to see if this was used at all? This was used internally to django-celery-results, and overriding it allowed us to add our custom fields to the dict.
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
reviewed
Aug 31, 2023
bjester
requested changes
Sep 22, 2023
Member
bjester
left a comment
There was a problem hiding this comment.
Some important notes on the CeleryAsyncResult properties (if they're actually being used still)
bjester
approved these changes
Oct 30, 2023
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Description of the change(s) you made
Manual verification steps performed
Does this introduce any tech-debt items?
The only thing that comes to mind is find_incomplete_ids function being executed before the celery TaskObject is saved to the backend asynchronously. This edge case is very difficult to happen relatively as there should surely be some latency due to request, which would ensure the saving of the celery TaskObject in the backend safely. Just to give out some figures the test test_revoke_task when not having a delay between enqueuing and revoking the same tasks creates the above-mentioned issue but if we add a delay of just 0.5 seconds this edge case is not caused.
References
closes #4222
Comments
Contributor's Checklist
PR process:
CHANGELOGlabel been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocslabel has been added if this introduces a change that needs to be updated in the user docs?requirements.txtfiles also included in this PRStudio-specifc:
notranslateclass been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages,components, andlayoutsdirectories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarnandpip)WIP