This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-2-test by this push:
     new 12e4a89cf09 [v3-2-test] UI: Stop polling getLatestRunInfo on paused 
Dags with no active runs (#67249) (#67256)
12e4a89cf09 is described below

commit 12e4a89cf09637431ec2616c6611c85b500084ad
Author: Yeonguk Choo <[email protected]>
AuthorDate: Thu May 21 04:30:53 2026 +0900

    [v3-2-test] UI: Stop polling getLatestRunInfo on paused Dags with no 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 3047ad7fa3cbb8d442840111bed7febfab0a767e)
    
    Co-authored-by: Brent Bovenzi <[email protected]>
---
 airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx                 | 2 +-
 airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx 
b/airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx
index f6039c68f32..95634cb9245 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx
@@ -88,7 +88,7 @@ export const Dag = () => {
 
   // Ensures continuous refresh to detect new runs when there's no
   // pending state and new runs are initiated from other page
-  useRefreshOnNewDagRuns(dagId, hasPendingRuns);
+  useRefreshOnNewDagRuns(dagId, hasPendingRuns, dag?.is_paused);
 
   const {
     data: latestRun,
diff --git a/airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts 
b/airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts
index 2fb7673ad29..174d9c9962f 100644
--- a/airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useRefreshOnNewDagRuns.ts
@@ -28,7 +28,11 @@ import {
 import { gridQueryKeys } from "./gridViewQueryKeys";
 import { useConfig } from "./useConfig";
 
-export const useRefreshOnNewDagRuns = (dagId: string, hasPendingRuns: boolean 
| undefined) => {
+export const useRefreshOnNewDagRuns = (
+  dagId: string,
+  hasPendingRuns: boolean | undefined,
+  isPaused?: boolean,
+) => {
   const queryClient = useQueryClient();
   const hasSyncedLatestRunRef = useRef(false);
   const previousLatestRunSignatureRef = useRef("");
@@ -38,7 +42,7 @@ export const useRefreshOnNewDagRuns = (dagId: string, 
hasPendingRuns: boolean |
 
   const { data: latestDagRun } = useDagServiceGetLatestRunInfo({ dagId }, 
undefined, {
     enabled: Boolean(dagId),
-    refetchInterval: Boolean(dagId) && !hasPendingRuns ? pollIntervalMs : 
false,
+    refetchInterval: Boolean(dagId) && !hasPendingRuns && !isPaused ? 
pollIntervalMs : false,
   });
 
   useEffect(() => {

Reply via email to