[ https://issues.apache.org/jira/browse/AIRFLOW-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Imberman closed AIRFLOW-133. ----------------------------------- Resolution: Auto Closed > SLAs don't seem to work with schedule_interval=None > --------------------------------------------------- > > Key: AIRFLOW-133 > URL: https://issues.apache.org/jira/browse/AIRFLOW-133 > Project: Apache Airflow > Issue Type: Bug > Components: scheduler > Affects Versions: 1.7.0 > Reporter: Eric Johnson > Assignee: Siddharth Anand > Priority: Minor > > The issue is pretty simple. It looks like if you have a DAG with a > {{schedule_interval=None}}, you can't use an SLA with it. I'm running Airflow > 1.7.0 and it runs into trouble in jobs.py at this line around line 255. > {{dttm = dag.following_schedule(dttm)}} > I assume because there is no schedule to follow. > I've provided a simple example to illustrate the issue. It's a task that will > take 2 minutes but the SLA is set at 1 minute. The SLA is not enforced. > {code} > from builtins import range > from airflow.operators import BashOperator, DummyOperator, TimeSensor > from airflow.models import DAG > from datetime import datetime, timedelta, time > one_day_ago = datetime.combine(datetime.today() - timedelta(1), > datetime.min.time()) > args = { > 'owner': 'ejohnson', > 'start_date' : one_day_ago, > 'email' : "ejohn...@sample.com", > 'email_on_failure' : True > } > # This sets up the daily build jobs > build_dir = DAG( > dag_id='DailyBuild', > default_args=args, > schedule_interval=None) > build = BashOperator( > task_id='build', > bash_command='sleep 2m', > sla=timedelta(minutes=1), > dag=build_dir) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)