seanghaeli commented on code in PR #75708:
URL: https://github.com/apache/airflow/pull/75708#discussion_r4496854655
##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -861,6 +862,15 @@ def _process_dagrun_deadline_alerts(
)
stats.incr("deadline_alerts.deadline_creation_failed",
tags=metrics_tags)
+ # An alert can roll the session back, discarding the pending
DagRun. Carrying on would
+ # add Deadlines that violate the dagrun_id foreign key, and
returning normally would let
+ # the caller treat the missing run as created.
+ if orm_dagrun not in session:
Review Comment:
The asset paths look good now. Found this in testing: when an alert keeps
rolling back, the run is retried every loop, so the Dag never runs, and each
retry also throws away the runs other Dags created earlier in the same tick. In
Breeze, an asset-scheduled Dag with a bad alert kept an unrelated every-minute
Dag from getting any runs until I fixed the alert. Could we evaluate the alerts
on their own session (`create_session(scoped=False)`) and keep this check as a
backstop? Then a rollback inside an alert only hits that session, the alert is
skipped, and the run is still created.
--
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]