removed the wait on case upload record #34741
Merged
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.
Technical Summary
The case uploader needs to create a case upload record that contains the task ID. Currently, that is done by first creating the task so that we have a task id, then generated the case upload record, and then finally causing the spawned task to sleep until it sees that case upload record, in order to avoid a race condition. In environments that use
CELERY_TASK_ALWAYS_EAGER
, this process will time out, as the task will attempt to execute fully before the case upload record is created.Instead, it appears that celery supports syntax to assign task IDs directly (see here). This avoids the same race condition, allows us to remove code, and lets this run with
CELERY_TASK_ALWAYS_EAGER
enabled.Safety Assurance
Safety story
Verified this locally. I also verified that the task ID specified is indeed that task ID that is used within the task.
Automated test coverage
I'm not quite clear if automated tests are appropriate here. The main test I think is essentially a library test -- we want to verify that we can assign custom task IDs, and that's really celery's code, not ours.
QA Plan
No QA
Rollback instructions
Labels & Review