Skip to content

Re-anchor custom queued deadline references when a Dag run is cleared - #71850

Draft
rjgoyln wants to merge 1 commit into
apache:mainfrom
rjgoyln:deadline-custom-queued-reanchor
Draft

Re-anchor custom queued deadline references when a Dag run is cleared#71850
rjgoyln wants to merge 1 commit into
apache:mainfrom
rjgoyln:deadline-custom-queued-reanchor

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

A custom deadline reference registered as DeadlineReference.TYPES.DAGRUN_QUEUED is never re-anchored when its Dag run is cleared — the built-in DAGRUN_QUEUED_AT deadline moves to the new queued_at, the custom one keeps pointing at the old one.

The registered timing only ever existed in the in-memory DeadlineReference.TYPES tuples 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 than serialize_reference(), because custom references are expected to override that method and an override would drop the field.

_recalculate_dagrun_queued_at_deadlines has 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?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

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
rjgoyln force-pushed the deadline-custom-queued-reanchor branch from 45de3bf to a66b446 Compare August 19, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom deadline references registered as TYPES.DAGRUN_QUEUED are not re-anchored when a DagRun is cleared

1 participant