ABiscuitttt opened a new pull request, #70506:
URL: https://github.com/apache/airflow/pull/70506

   When `TriggerDagRunOperator` targets a nonexistent Dag (or the API server 
otherwise rejects the trigger with 403/5xx), the supervisor reports the error 
by raising `AirflowRuntimeError` from the `TriggerDagRun` comms round-trip. 
That raise happens inside `run()`'s `except DagRunTriggerException` handler, 
and an exception raised in an except handler is not caught by the sibling 
except clauses — it escaped `run()` entirely. `main()` then never reached 
`finalize()`, the only place `on_task_instance_failed` / `on_failure_callback` 
listeners run. The task still showed FAILED in the UI (via the supervisor's 
exit-code fallback), but alerting plugins were silently skipped for exactly 
this failure mode.
   
   The fix routes the error through the normal failure path 
(`_handle_current_task_failed`), so the task returns a terminal state, 
`finalize()` fires the listeners, and retry policy is honored (`UP_FOR_RETRY` 
when retries remain).
   
   Regression tests cover both the no-retry (`FAILED`) and retry 
(`UP_FOR_RETRY`) paths, asserting the terminal state reaches the supervisor 
instead of the error escaping `run()`.
   
   closes: #63089
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Kimi Code CLI
   
   Generated-by: Kimi Code CLI following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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]

Reply via email to