shivaam commented on code in PR #68961:
URL: https://github.com/apache/airflow/pull/68961#discussion_r3471719063
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -1164,6 +1173,30 @@ def _emit_dagrun_span(self, state: DagRunState):
span.set_status(status_code)
span.end()
+ def _handle_missed_deadlines(self, *, session: Session) -> None:
+ deadline_query = (
+ select(Deadline)
+ .where(Deadline.dagrun_id == self.id)
+ .where(~Deadline.missed)
+ .options(selectinload(Deadline.callback),
selectinload(Deadline.dagrun))
+ )
+ for deadline in session.scalars(
+ with_row_locks(
+ deadline_query,
+ of=Deadline,
+ session=session,
+ skip_locked=True,
+ key_share=False,
+ )
+ ):
+ deadline.handle_miss(session)
+
+ def _handle_missed_deadlines_with_error_capture(self, *, session: Session)
-> None:
+ try:
+ self._handle_missed_deadlines(session=session)
+ except Exception:
Review Comment:
missed deadline is a side effect and it should not impact the state change
of the dag.
--
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]