You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/04 11:18:59 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #14064: Skip SLA check only if SLA is None

kaxil commented on a change in pull request #14064:
URL: https://github.com/apache/airflow/pull/14064#discussion_r570144364



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -419,7 +419,7 @@ def manage_slas(self, dag: DAG, session: Session = None) -> None:
         ts = timezone.utcnow()
         for ti in max_tis:
             task = dag.get_task(ti.task_id)
-            if not isinstance(task.sla, timedelta):
+            if not task.sla:

Review comment:
       The problem with this approach is it will fail the entire DagfileProcessorProcess that is running SlaCallback.
   
   So imagine if there are 5 tasks, only 1 of them has `task.sla=3` and others have `task.sla=timedelta(seconds=3)`, then with the current change it will raise type error and will not run or check sla for Tasks that have correct task.sla set.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org