Skip to content

UI: Fix task states stuck stale when a run finishes quickly#70319

Merged
bbovenzi merged 1 commit into
apache:mainfrom
Andrushika:fix-graph-ti-state-stuck-after-run-finish
Jul 24, 2026
Merged

UI: Fix task states stuck stale when a run finishes quickly#70319
bbovenzi merged 1 commit into
apache:mainfrom
Andrushika:fix-graph-ti-state-stuck-after-run-finish

Conversation

@Andrushika

Copy link
Copy Markdown
Contributor

Why

The Grid/Graph task badges come from the ti_summaries stream. The stream only re-fetches while the dag run is active. If the run finishes before the next tick (default 3s), the interval is cleared and the final task states are never fetched. The badge then stays stale until a remount.
I was testing my dag (which can finish within 3s). After it finished, the badge kept showing "no status" while the run panel already showed success:

2026-07-24.1.29.43.mov

What

useGridTiSummariesStream now remembers whether the runs were active in a ref. When they go from active to terminal, it bumps refreshTick once, which triggers one final re-stream through the existing fetch path. Grid and Graph share this hook, so both views get the fix.
Added two tests: the final re-stream happens exactly once (fails without the fix), and opening an already-finished run does not fetch twice.

After:

2026-07-24.2.44.01.mov
Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 4.8 following the guidelines


  • 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.

The Grid/Graph TI-summaries stream re-fetches on an interval that is
gated on the dag run still being active. When a run reaches a terminal
state before the next tick fires — common for sub-interval runs on
low-latency deployments — the interval is cleared without ever fetching
the final task states, so node badges and grid cells stay frozen on
whatever the last stream saw (often "no status") until a full remount.

Re-stream once on the active→terminal transition so the final states
always land, mirroring the self-gating behaviour of the polled run
queries which never stop before observing a terminal state.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 23, 2026
@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 24, 2026
@bbovenzi bbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Jul 24, 2026
@bbovenzi
bbovenzi merged commit 47a0324 into apache:main Jul 24, 2026
89 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

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-3-test PR Link

@Andrushika
Andrushika deleted the fix-graph-ti-state-stuck-after-run-finish branch July 24, 2026 17:31
shahar1 pushed a commit that referenced this pull request Jul 25, 2026
…ly (#70319) (#70397)

The Grid/Graph TI-summaries stream re-fetches on an interval that is
gated on the dag run still being active. When a run reaches a terminal
state before the next tick fires — common for sub-interval runs on
low-latency deployments — the interval is cleared without ever fetching
the final task states, so node badges and grid cells stay frozen on
whatever the last stream saw (often "no status") until a full remount.

Re-stream once on the active→terminal transition so the final states
always land, mirroring the self-gating behaviour of the polled run
queries which never stop before observing a terminal state.
(cherry picked from commit 47a0324)

Co-authored-by: Andrew Chang <69671930+Andrushika@users.noreply.github.com>
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-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants