Repository navigation
[v3-3-test] Fix Dag scheduling stall after switching to a coarser cron (#72498) - #72679
Merged
Merged
Conversation
#72498) * Fix Dag scheduling stall after switching to a coarser cron Changing a Dag's schedule to a coarser cron (e.g. hourly to daily) could make the realigned next run collide with the logical_date of the run already on record. The scheduler would then loop on "run already exists; skipping dagrun creation" forever instead of advancing, since every input to the recompute (the DAG's static start_date, the stale reference run) is a fixed constant that reproduces the identical collision every time. A single-step guard for this class of collision already existed for the narrower case of a CronTriggerTimetable-to-CronDataIntervalTimetable switch. A single step turns out to always be enough for both shipped _DataIntervalTimetable subclasses, but only because of invariants that are specific to them and aren't enforced anywhere -- a custom Timetable isn't guaranteed to uphold them. Retry a bounded number of times instead of assuming one step suffices, and fail loudly if that budget is exhausted rather than looping unbounded, which would otherwise hang the scheduler's main loop for every Dag if a future _get_next implementation ever stopped strictly advancing. * Simplify the coarser-schedule-stall guard to a single bounded retry Only one advance past the previous run's start is provably necessary for both shipped _DataIntervalTimetable subclasses; a second retry was unproven margin that only existed to satisfy a synthetic test case, not any real or documented timetable behavior. A bounded while loop implied that margin was load-bearing. Replacing it with a single retry followed by a loud failure keeps the same fail-fast guarantee -- a custom Timetable needing more than one step is still caught immediately rather than silently retried -- while matching what the invariant actually proves. * Use ValueError for timetable alignment guard * Avoid exposing timetable internals in error message * Simplify schedule change test runner helper * Clarify zero-length interval test wording * Clarify coarser schedule regression test comment (cherry picked from commit 3111701) Co-authored-by: Jason(Zhe-You) Liu <[email protected]>
jason810496
approved these changes
Sep 8, 2026
Lee-W
approved these changes
Sep 8, 2026
vatsrahul1001
approved these changes
Sep 8, 2026
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.
(cherry picked from commit 3111701)
Co-authored-by: Jason(Zhe-You) Liu [email protected]