fix(scheduler): ignore stale executor success after defer reschedule#66431
Open
Pedrinhonitz wants to merge 4 commits intoapache:mainfrom
Open
fix(scheduler): ignore stale executor success after defer reschedule#66431Pedrinhonitz wants to merge 4 commits intoapache:mainfrom
Pedrinhonitz wants to merge 4 commits intoapache:mainfrom
Conversation
When a trigger moves a deferred task back to scheduled before the scheduler processes the executor success from the worker defer exit, treat it as benign (same try_number, next_method set) instead of state mismatch failure. Closes apache#66374 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
jscheffl
reviewed
May 5, 2026
jscheffl
approved these changes
May 5, 2026
Contributor
jscheffl
left a comment
There was a problem hiding this comment.
Looks good for me. Thanks for the fix!
As I am not 100% deep in the scheduler feel not comfortable to mege, so if there is a second pair of eyes from reviewer would be cool, else LGTM!
Author
|
Perfect! I'm also eagerly awaiting another review and am open to other suggestions for resolving this issue. Thank you for your review. |
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
Fixes a race where the trigger resumes a deferred task to
scheduledbefore the scheduler processes the executorSUCCESSfrom the worker defer exit. The scheduler then treatedscheduledvs executorsuccessas a state mismatch and failed the TI (#66374).Changes
process_executor_events, treat executorSUCCESSwhile the TI isSCHEDULEDwithnext_methodset (same try) as a stale defer-exit event, consistent with the existing “requeued after defer” intent.test_process_executor_events_stale_success_when_scheduled_after_defer(positive + negative withoutnext_method).66374.bugfix.rst.Testing
Was generative AI tooling used to co-author this PR?
Generated-by: Cursor following the guidelines