airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Johnson (JIRA)" <>
Subject [jira] [Created] (AIRFLOW-133) SLAs don't seem to work with schedule_interval=None
Date Wed, 18 May 2016 19:34:12 GMT
Eric Johnson created AIRFLOW-133:

             Summary: SLAs don't seem to work with schedule_interval=None
                 Key: AIRFLOW-133
             Project: Apache Airflow
          Issue Type: Bug
          Components: scheduler
    Affects Versions: Airflow 1.7.0
            Reporter: Eric Johnson
            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
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. 

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( - timedelta(1), datetime.min.time())

args = {
    'owner': 'ejohnson',
    'start_date' : one_day_ago,
    'email' : "",
    'email_on_failure' : True

# This sets up the daily build jobs
build_dir = DAG(

build = BashOperator(
    bash_command='sleep 2m',

This message was sent by Atlassian JIRA

View raw message