Skip to content

Fix autorefresh for deadlines and paused dags#67249

Merged
choo121600 merged 3 commits into
apache:mainfrom
astronomer:improve-autorefresh
May 20, 2026
Merged

Fix autorefresh for deadlines and paused dags#67249
choo121600 merged 3 commits into
apache:mainfrom
astronomer:improve-autorefresh

Conversation

@bbovenzi
Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi commented May 20, 2026

  • Do not run autorefrsh on paused dags
  • Do not autorefresh deadlines when there are no alerts on the dag or when the dag has no pending runs

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    Clause Sonnet 4.6

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.
bbovenzi added 3 commits May 20, 2026 10:40
useRefreshOnNewDagRuns was polling every 5 s indefinitely whenever
hasPendingRuns was false, including on Dags that are paused and have
no active runs. Pass isPaused from the Dag details into the hook and
skip the refetchInterval when the Dag is paused and idle.
useDeadlines was polling at full rate on any non-paused Dag, even with
no active runs. Pass checkPendingRuns: true to useAutoRefresh so the
deadline query pauses when idle and resumes automatically when a new
run starts.
If the Dag has no deadline alerts configured, there can never be any
deadline instances. Fetch the alert config first (one-shot) and gate
the useDeadlines query on total_entries > 0, avoiding the polling
request entirely for the common case.
@bbovenzi bbovenzi added this to the Airflow 3.2.2 milestone May 20, 2026
@bbovenzi bbovenzi added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 20, 2026
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 20, 2026
@bbovenzi bbovenzi changed the title Fix deadlines and paused dag autorefresh Fix autorefresh for deadlines and paused dags May 20, 2026
Copy link
Copy Markdown
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@choo121600 choo121600 merged commit 3047ad7 into apache:main May 20, 2026
83 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Backport failed to create: v3-2-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 3047ad7 v3-2-test

This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

bbovenzi added a commit that referenced this pull request May 20, 2026
…active runs (#67249) (#67256)

useRefreshOnNewDagRuns was polling every 5 s indefinitely whenever
hasPendingRuns was false, including on Dags that are paused and have
no active runs. Pass isPaused from the Dag details into the hook and
skip the refetchInterval when the Dag is paused and idle.

Note: backport applies only the paused-Dag polling fix from #67249.
The deadline-related changes are skipped because the deadline-alerts
feature is not present in v3-2-test.

(cherry picked from commit 3047ad7)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…active runs (#67249) (#67256)

useRefreshOnNewDagRuns was polling every 5 s indefinitely whenever
hasPendingRuns was false, including on Dags that are paused and have
no active runs. Pass isPaused from the Dag details into the hook and
skip the refetchInterval when the Dag is paused and idle.

Note: backport applies only the paused-Dag polling fix from #67249.
The deadline-related changes are skipped because the deadline-alerts
feature is not present in v3-2-test.

(cherry picked from commit 3047ad7)

Co-authored-by: Brent Bovenzi <brent@astronomer.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

2 participants