dheerajturaga commented on code in PR #72407:
URL: https://github.com/apache/airflow/pull/72407#discussion_r3942080593
##########
airflow-core/src/airflow/api/common/trigger_dag.py:
##########
@@ -82,6 +85,16 @@ def _trigger_dag(
if (dag := dag_bag.get_latest_version_of_dag(dag_id, session=session)) is
None:
raise DagNotFound(f"Dag id {dag_id} not found")
+ dag_model = session.scalar(
+ with_row_locks(
+ select(DagModel).where(DagModel.dag_id == dag_id),
+ of=DagModel,
+ session=session,
+ )
+ )
+ if dag_model and dag_model.is_draining:
+ raise DagIsDraining(f"Dag '{dag_id}' is draining and does not accept
new runs")
Review Comment:
agreed, I was thinking the same. I fixed this
--
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]