Re-anchor custom queued deadline references when a Dag run is cleared - #71850
Draft
rjgoyln wants to merge 1 commit into
Draft
Re-anchor custom queued deadline references when a Dag run is cleared#71850rjgoyln wants to merge 1 commit into
rjgoyln wants to merge 1 commit into
Conversation
The evaluation timing a reference is registered with only lived in the in-memory registry of the process that ran the Dag file, so the scheduler had no way to tell a queued-anchored reference from any other and fell back to matching the built-in class name. Custom references registered as DeadlineReference.TYPES.DAGRUN_QUEUED were silently left pointing at the old queued_at. closes: apache#71747
rjgoyln
force-pushed
the
deadline-custom-queued-reanchor
branch
from
August 19, 2026 18:42
45de3bf to
a66b446
Compare
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
A custom deadline reference registered as
DeadlineReference.TYPES.DAGRUN_QUEUEDis never re-anchored when its Dag run is cleared — the built-inDAGRUN_QUEUED_ATdeadline moves to the newqueued_at, the custom one keeps pointing at the old one.The registered timing only ever existed in the in-memory
DeadlineReference.TYPEStuples of the process that ran the Dag file, so the scheduler could identify a queued-anchored deadline only by matching the built-in class name, which no custom class satisfies. The timing now travels with the reference and is stored on the alert row for the clear path to select on. The serializer adds it rather thanserialize_reference(), because custom references are expected to override that method and an override would drop the field._recalculate_dagrun_queued_at_deadlineshas a second, unrelated bug with JSON-encoded intervals (#70370), so the tests store a numeric interval to stay clear of it.Compatibility
Alerts serialized before this change carry no timing, so the built-in name comparison stays as a fallback until each Dag is parsed again.
closes: #71747
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines