Eng 2714 add check for callbacks on requeue#7431
Merged
Conversation
…y function" This reverts commit e56928b.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Greptile SummaryThis PR extends the interrupted task requeue logic to prevent false positive cancellations of privacy requests that have callback-based async tasks. The helper function Key changes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 329a040 |
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.
Ticket ENG-2714
Description Of Changes
Fix requeue_interrupted_tasks incorrectly erroring privacy requests that are legitimately awaiting an async webhook (callback) response.
When a connector uses the callback strategy (e.g. gateway_api with erase_after), the request runner exits after the initial request and waits for the external system to hit our webhook. Downstream tasks remain in pending status with no Celery task ID because they depend on gateway completing first. The periodic requeue_interrupted_tasks job sees those pending tasks with no task ID, determines they are "stuck," and errors the entire privacy request -- even though it is legitimately waiting for a callback.
This was already handled for async polling tasks (via _has_polling_tasks), but not for async callback (webhook) tasks.
Code Changes
_has_polling_taskswith_has_async_tasks_awaiting_external_completion-- a unified helper that returns True if the privacy request has any RequestTask with async_type in (polling, callback).Steps to Confirm
The callback connector's erasure task enters awaiting_processing with async_type=callback (waiting for webhook).
The dependent connector's erasure task stays pending (blocked by erase_after).
With fix: Status remains in_processing -- the request is correctly recognized as awaiting external callback completion.
Without fix: Status would change to error because the dependent connector's pending task (no cached Celery task ID) was incorrectly treated as stuck.
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works