Skip to content

UI: Task Instance page freezes after Mark-as on main (post-#67212) #67884

@neochaotic

Description

@neochaotic

Under which category would you file this issue?

Airflow Core

Apache Airflow version

main (commit 707e316, post-3.2.2)

What happened and how to reproduce it?

After marking a task instance as failed/success, the UI becomes
unresponsive — buttons and links stop reacting to clicks. The state badge
itself updates correctly (this part was fixed by #67212), but the page
freezes for several seconds and a hard refresh is needed to recover.

DevTools Network shows 3 back-to-back GET /ui/grid/ti_summaries/...
NDJSON stream calls
triggered by the new cache-subscriber watcher in
useGridTISummaries.ts. Each stream re-runs setSummariesByRunId(...)
once per emitted line (~14 lines per stream), producing ~42 React state
updates in quick succession on top of an already-busy page render —
which matches the user-observed freeze.

Steps to reproduce

  1. Run airflow standalone from main HEAD with examples enabled.
  2. Trigger any DAG (e.g. tutorial_dag) and let a task finish.
  3. Open the Task Instance page.
  4. Open DevTools → Network → filter Fetch/XHR.
  5. Click the ✓/✗ menu → mark as failed → confirm.
  6. Observe: 3 tutorial_dag?run_ids=... (initiator
    useGridTISummariesStream) fire. Page becomes unclickable for ~3-5s.

What you think should happen instead?

The watcher should debounce all mutation-driven invalidations into a
single re-stream, the same way it already attempts via clearTimeout /
setTimeout(..., 0). The page should remain responsive after the mark.

What I have verified

  • Reproduces on a clean checkout of main HEAD (707e316), no source
    modifications, vanilla pnpm dev against apache/airflow:3.2.2
    standalone as backend (proxied via vite).
  • Network panel confirms 3 stream fetches per mark action, not 1.
  • Suspect site:
    airflow-core/src/airflow/ui/src/queries/useGridTISummaries.ts lines
    140-165 — the cache-subscriber watcher added in Improve query validation, including for streaming #67212.
  • usePatchTaskInstance.onSuccessFn invalidates several watched keys
    inside a Promise.all. Each invalidation queues a microtask;
    setTimeout(..., 0) runs in a separate macrotask, so the clearTimeout
    debounce may not coalesce when the invalidation events span more than
    one microtask cycle.

Operating System

macOS 15.5

Apache Airflow Provider(s)

n/a

Versions of Apache Airflow Providers

n/a

Deployment

Other Docker-based deployment

Deployment details

apache/airflow:3.2.2 for backend; UI served from pnpm dev on main
HEAD with vite proxy to the standalone container.

Anything else?

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:UIRelated to UI/UX. For Frontend Developers.kind:bugThis is a clearly a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions