doiken commented on code in PR #26968:
URL: https://github.com/apache/airflow/pull/26968#discussion_r1013564570
##########
airflow/dag_processing/processor.py:
##########
@@ -425,7 +425,7 @@ def manage_slas(self, dag: DAG, session: Session = None) ->
None:
if next_info is None:
break
if (ti.dag_id, ti.task_id, next_info.logical_date) in
recorded_slas_query:
- break
+ continue
Review Comment:
> This seems like a change in behaviour
I would like not to change but fix the behaviour changed by
https://github.com/apache/airflow/pull/19553.
I think the current sla check behaviour is split as follows
- No SlaMiss record: all task instances missing sla are recorded
- SlaMiss record already exists: no task instance is recorded by `break`
> It seems like it's going to record too many SLAs this way.
Only tasks satisfying `next_info.logical_date + task.sla < ts` are recorded.
If we want to `break` here,
I think we need break after first SlaMiss is appended as well to keep
behaviour consistent.
```
...
sla_miss = SlaMiss(
task_id=ti.task_id,
dag_id=ti.dag_id,
execution_date=next_info.logical_date,
timestamp=ts,
)
sla_misses.append(sla_miss)
Stats.incr('sla_missed')
break
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]