airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Riccomini (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRFLOW-133) SLAs don't seem to work with schedule_interval=None
Date Thu, 19 May 2016 03:12:12 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15290385#comment-15290385
] 

Chris Riccomini commented on AIRFLOW-133:
-----------------------------------------

I'm curious--what is a DAG with no schedule_interval supposed to do? The only use case that
I can think of is to be run with trigger_dag, or something similar. If something has now schedule_interval,
how can it miss an SLA?

> 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)

Mime
View raw message