You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "juteasl (via GitHub)" <gi...@apache.org> on 2026/08/10 15:06:58 UTC

[I] Pausing a DAG stalls already-running DagRuns instead of only blocking new ones [airflow]

juteasl opened a new issue, #71381:
URL: https://github.com/apache/airflow/issues/71381

   ### Description
   
   When a DAG is paused while it has an active (running) DagRun — e.g. one started via manual trigger before the pause, or a manual trigger on an already-paused DAG that got an initial burst of tasks dispatched — the scheduler stops scheduling further task instances for that run. The run doesn't fail and logs no error; it simply stalls indefinitely in `running` state with remaining tasks stuck in `scheduled`, `queued_when=None`, never sent to the executor.
   
   This happens because `is_paused` is checked as a single gate that governs both "should new DagRuns be created" and "should ready task instances in existing DagRuns be scheduled." The two are conflated.
   
   ### Use case/motivation
   
   Pause is a reasonable way to say "don't start new runs of this DAG." It's not intuitive that it also freezes runs already in flight — especially since:
   - No error, warning, or DAG/task state reflects why the run stopped progressing.
   - A manually triggered run against a paused DAG appears to start successfully (initial tasks execute), masking the problem until the run has been silently stuck for several minutes.
   - The eventual fix (unpause) has a side effect the operator may not want: it also releases scheduling for *new* runs of that DAG, when the operator's only goal was to unstick the one in-flight run.
   
   ### Suggested change
   
   Preserve pre-run pause semantics: `is_paused` should gate DagRun *creation*, not task-instance scheduling for DagRuns already in `running` state. A DagRun that starts (however it started) while unpaused, or that gets tasks dispatched before a pause takes effect, should be allowed to run to completion. If the DAG is still paused when the run finishes, subsequent runs are blocked as expected — pause state before and after the run is preserved; only the in-flight run is exempted.
   
   At minimum, surfacing this in the UI/logs (e.g., a task/run banner: "this DagRun's DAG is paused; scheduling is suspended") would prevent the silent-stall confusion, even if the gating behavior itself is kept as-is by design.
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Pausing a DAG stalls already-running DagRuns instead of only blocking new ones [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #71381:
URL: https://github.com/apache/airflow/issues/71381#issuecomment-5242116206

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org