Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_active_runs ignored with externally triggered DAGs #19344

Closed
1 of 2 tasks
easthy-alterpost opened this issue Nov 1, 2021 · 1 comment
Closed
1 of 2 tasks

max_active_runs ignored with externally triggered DAGs #19344

easthy-alterpost opened this issue Nov 1, 2021 · 1 comment
Labels
area:core kind:bug This is a clearly a bug

Comments

@easthy-alterpost
Copy link

easthy-alterpost commented Nov 1, 2021

Apache Airflow version

2.1.4

Operating System

Amazon Linux 2 AMI

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

Cloudformation template based on https://github.com/villasv/aws-airflow-stack/blob/v2/aws/cloud-formation-template.yml

What happened

DAG can have multiple active runs despite of max_active_runs set to 1 when it is triggered externally from TriggerDagRunOperator

What you expected to happen

If DAG has max_active_runs = 1 it should never be started more than once

How to reproduce

DAG #1

with DAG('dag_1',
                default_args=default_args,
                max_active_runs=1,
                start_date=datetime(2021, 11, 1),
                schedule_interval="* * * * *",
                dagrun_timeout=timedelta(minutes=1),
                catchup=False) as dag:

    TriggerDagRunOperator(task_id='trigger_dag_2',
                                                          trigger_dag_id='dag_2')

DAG #2

from airflow.operators.bash import BashOperator

with DAG('dag_2',
                default_args=default_args,
                max_active_runs=1,
                start_date=datetime(2021, 11, 1),
                schedule_interval=None,
                dagrun_timeout=timedelta(minutes=10),
                catchup=False) as dag:

    BashOperator(
        task_id="dag_keeper",
        bash_command="sleep 5m"
    )

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@easthy-alterpost easthy-alterpost added area:core kind:bug This is a clearly a bug labels Nov 1, 2021
@bhavaniravi
Copy link
Contributor

Duplicate of #18583
This PR #18226 have fixed this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

3 participants