airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arthur Wiedmer (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-323) Should be able to prevent tasks from overlapping across multiple DAG Runs
Date Mon, 11 Jul 2016 18:00:12 GMT


Arthur Wiedmer commented on AIRFLOW-323:

Hi Isaac, it sounds like there are a couple of things that could help you :
1) You can set max_active_runs for the DAG to 1 to ensure that only one dag run is active
at a time. In this case, only one dag run will be executed at a time.
2) You can set depend_on_past to True such that this task will not execute unless the previous
one completes.
3) Finally, you can make this DAG use a pool with one slot, such that this task basically
takes a lock on this particular resource.

Though ideally, if several tasks are competing for the same resource, you might not want to
schedule them at a cadence that will introduce contention...

> Should be able to prevent tasks from overlapping across multiple DAG Runs
> -------------------------------------------------------------------------
>                 Key: AIRFLOW-323
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: Airflow
>         Environment:
>            Reporter: Isaac Steele
>            Assignee: Isaac Steele
> As a the Airflow administrator,
> If a task from a previous DAG Run is still running when the next scheduled run triggers
the same task, there should be a way prevent the tasks from overlapping.
> Otherwise the same code could end up running multiple times simultaneously.
> To reproduce:
> 1) Create a DAG with a short scheduled interval
> 2) Create a task in that DAG to run longer than the interval
> Result: Both tasks end up running that the same time.
> This can cause tasks to compete for resources as well as duplicating or overwriting what
the other task is doing.

This message was sent by Atlassian JIRA

View raw message