You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/28 20:11:49 UTC

[GitHub] [airflow] enriqueayala opened a new issue #18583: max_active_runs ignored with TriggerDagRunOperator

enriqueayala opened a new issue #18583:
URL: https://github.com/apache/airflow/issues/18583


   ### Apache Airflow version
   
   2.1.4 (latest released)
   
   ### Operating System
   
   Ubuntu 20.04
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   `max_active_runs` isn't respected when dag is triggered externally by TriggerDagRunOperator 
   
   ### What you expected to happen
   
   Limit number of concurrent runs specified by `max_active_runs` ,subsequent dag runs should allocated on new queue state 
   
   ### How to reproduce
   
   Modify example_dags\example_trigger_target_dag.py to limit `max_active_runs = 2 ` and add time.sleep for test convenience :
   ```
   
   from airflow import DAG
   from airflow.operators.bash import BashOperator
   from airflow.operators.python import PythonOperator
   from airflow.utils.dates import days_ago
   
   
   def run_this_func(**context):
       """
       Print the payload "message" passed to the DagRun conf attribute.
   
       :param context: The execution context
       :type context: dict
       """
       import time
       time.sleep(10)
       print(f"Remotely received value of {context['dag_run'].conf['message']} for key=message")
   
   
   
   with DAG(
       dag_id="example_trigger_target_dag",
       default_args={"owner": "airflow"},
       start_date=days_ago(2),
       schedule_interval=None,
       max_active_runs=2,
       tags=['example'],
   ) as dag:
   
       run_this = PythonOperator(task_id="run_this", python_callable=run_this_func)
   
       bash_task = BashOperator(
           task_id="bash_task",
           bash_command='echo "Here is the message: $message"',
           env={'message': '{{ dag_run.conf["message"] if dag_run else "" }}'},
       )
   
   ```
   
   And manually trigger multiple runs of example_trigger_controller_dag  :
   
   ![max_active_run_ignored](https://user-images.githubusercontent.com/10963531/135154981-304f145b-7e96-43d6-9f06-e7a565922206.PNG)
   
   
   
   
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit 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

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



[GitHub] [airflow] eladkal closed issue #18583: max_active_runs ignored with TriggerDagRunOperator

Posted by GitBox <gi...@apache.org>.
eladkal closed issue #18583:
URL: https://github.com/apache/airflow/issues/18583


   


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



[GitHub] [airflow] ephraimbuddy commented on issue #18583: max_active_runs ignored with TriggerDagRunOperator

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #18583:
URL: https://github.com/apache/airflow/issues/18583#issuecomment-929592710


   This PR https://github.com/apache/airflow/pull/18226 seems to have 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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] eladkal closed issue #18583: max_active_runs ignored with TriggerDagRunOperator

Posted by GitBox <gi...@apache.org>.
eladkal closed issue #18583:
URL: https://github.com/apache/airflow/issues/18583


   


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