Jorricks commented on issue #18409:
URL: https://github.com/apache/airflow/issues/18409#issuecomment-924615761


   Hello @denysivanov,
   
   In the example code you submitted, you create a DagRun with status Running. 
However, this is done directly on the database and thereby you could consider 
this to be a manual overwrite.
   
   The limits, max_active_runs, are enforced by the scheduler component of 
Airflow. This component will create DagRuns based on the schedule and put them 
in the queued state first.   It will only mark them as running if that will not 
surpass any thresholds like the max_active_runs.
   
   By completely skipping those scheduler steps, there is no way for Airflow to 
enforce the limit on max_active_runs. Hence, I propose you change the code you 
showed to set the DagRun  to Queued state instead of Running. That should fix 
your issue :)


-- 
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