You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Eric Johnson (JIRA)" <ji...@apache.org> on 2016/05/18 19:34:12 UTC
[jira] [Created] (AIRFLOW-133) SLAs don't seem to work with
schedule_interval=None
Eric Johnson created AIRFLOW-133:
------------------------------------
Summary: 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: 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 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' : "ejohnson@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
(v6.3.4#6332)