[v3-3-test] Respect retries when a deferrable trigger ends a task with TaskFailedEvent (#69821) - #71163
Merged
Merged
Conversation
…Event (#69821) * Respect retries when a deferrable trigger ends a task with TaskFailedEvent When a deferrable operator's trigger yields a terminal TaskFailedEvent, the task was always marked failed and on_failure_callback ran, even with retries remaining. A worker-side failure with retries left instead goes up_for_retry and runs on_retry_callback. Route trigger-emitted failures through TaskInstance.handle_failure (the path the scheduler has used since #56586) so retry-eligibility is respected and the callback runs on_retry_callback vs on_failure_callback accordingly. closes: #69819 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Preserve retry history for trigger-ended deferred failures * Fix stale trigger callback comment --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit dd1f84a)
amoghrajesh
approved these changes
Aug 5, 2026
1 task
vatsrahul1001
added a commit
that referenced
this pull request
Aug 5, 2026
…Event (#69821) (#71163) * Respect retries when a deferrable trigger ends a task with TaskFailedEvent When a deferrable operator's trigger yields a terminal TaskFailedEvent, the task was always marked failed and on_failure_callback ran, even with retries remaining. A worker-side failure with retries left instead goes up_for_retry and runs on_retry_callback. Route trigger-emitted failures through TaskInstance.handle_failure (the path the scheduler has used since #56586) so retry-eligibility is respected and the callback runs on_retry_callback vs on_failure_callback accordingly. closes: #69819 * Preserve retry history for trigger-ended deferred failures * Fix stale trigger callback comment --------- (cherry picked from commit dd1f84a) Co-authored-by: Hemkumar Chheda <95332229+hkc-8010@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Backport of #69821 to
v3-3-testfor the 3.3.1 patch release.A deferrable task whose trigger ends it with a
TaskFailedEventwas routed straight toFAILED, ignoring remaining retries. This computes retry eligibility (loading the serialized task, same as the normal task path) and sends the callback asUP_FOR_RETRYwhen the task is still eligible, archiving the finished try totask_instance_historyso prior-try log lookups keep working.Cherry-picked with
-xfromdd1f84ab2034a14164e4d09310fba8fe1fa0395e. Conflict resolution: thedag_version/version_datacontext around the callback (and its dedicated test) is a main-only feature that does not exist onv3-3-test—TaskCallbackRequesthere has noversion_datafield — so that part was dropped, keeping only the retry fix (task_callback_type=callback_type) and readingbundle_name/bundle_versionthev3-3-testway. The fulltest_trigger.pysuite (38 tests) passes.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines