feat: route UploadFinisher to dedicated queue #634
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.
Summary
This PR separates
UploadFinishertasks fromUploadProcessortasks to prevent lightweight finishing operations from being blocked by heavy processing work.Problem
During high upload volume,
UploadFinishertasks were getting queued behindUploadProcessortasks, causing delays of up to 19 minutes for notification delivery. This is problematic because:UploadProcessortasks are heavy (parsing coverage files, can take minutes)UploadFinishertasks are lightweight (mark upload complete, trigger notifications)uploads/enterprise_uploads)Solution
Add an explicit route for
upload_finisher_task_namethat:upload_finisherqueue when configureduploadsqueue for backward compatibility (no config = no change)enterprise_upload_finishervia the existing routerKey Changes
Deployment
This change is safe to deploy independently:
uploadsqueue (no behavior change)Recommended deployment order:
Testing
test_celery_config.pyto include new route keytest_upload_finisher_has_separate_queueintest_router.pyto verify:upload_finisher→upload_finisherqueueupload→uploadsqueueupload_finisher→enterprise_upload_finisherqueueupload→enterprise_uploadsqueueNote
Separates lightweight
UploadFinishertasks from other upload tasks to avoid queue contention, with safe fallback behavior.upload_finisher_task_nameinBaseCeleryConfig.task_routes; resolves queue viasetup.tasks.upload_finisher.queue, falling back to the configureduploadqueue (_upload_queue) if unsetapp.tasks.upload.*routingtest_celery_config.py: includesapp.tasks.upload.UploadFinisherin expected routestest_router.py: verifies non-enterprise and enterprise routing forUploadFinishervs other upload tasks, including dedicatedenterprise_upload_finisherWritten by Cursor Bugbot for commit cb93891. This will update automatically on new commits. Configure here.