You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Daniel Mateus Pires (JIRA)" <ji...@apache.org> on 2018/06/22 13:25:00 UTC
[jira] [Commented] (AIRFLOW-133) SLAs don't seem to work with
schedule_interval=None
[ https://issues.apache.org/jira/browse/AIRFLOW-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16520342#comment-16520342 ]
Daniel Mateus Pires commented on AIRFLOW-133:
---------------------------------------------
Any update on this ?
Seems like SLAs still do not work on triggered DAGs in 1.9.0
- Also, I am not sure I understand the whole SLA concept.
- Is there a concept of an SLA at the DAG level or is it only Task level SLAs ?
- Am I right in stating: SLAs are like timeouts, except the tasks / dags do not get killed ?
- Also, the alerting system seems to be completely different from the failures as alerting is managed by the scheduler whereas in the case of task failures the alerting is managed by the worker(s) what's the motivation for that ?
> 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
(v7.6.3#76005)