avanish-garg commented on issue #36516:
URL: https://github.com/apache/airflow/issues/36516#issuecomment-5497180707

   Hi @potiuk — saw this traces back to #18511 where you agreed extending the 
hook system was the
   better fit than polling. Opened a draft PR with an implementation: 
https://github.com/apache/airflow/pull/72378.
   
   **Approach**: new `on_dag_pause_status_change(dag, is_paused)` hookspec in
   `airflow/listeners/spec/dag.py`, mirroring the existing pattern in 
`listeners/spec/dagrun.py`.
   Fires from `patch_dag()` (REST API) and the `airflow dags pause`/`unpause` 
CLI commands when
   `is_paused` actually changes. Scoped to those two user-initiated paths for 
now — the scheduler's
   automatic `max_consecutive_failed_dag_runs` circuit breaker also flips 
`is_paused` but does it via
   a bulk UPDATE without loading a `DagModel` instance, so wiring that one in 
would need more
   restructuring; happy to add it as a follow-up if useful.
   
   Opened as a draft to make this concrete rather than just talk about it — not 
asking for merge yet,
   happy to rework based on feedback.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to