sameerpandey17 commented on issue #46224:
URL: https://github.com/apache/airflow/issues/46224#issuecomment-7193118193

   I've opened #77637 , which makes `email_on_failure` / `email_on_retry` work 
when a trigger ends a task. I kept it to emails to keep it reviewable.
   
   Retries and callbacks for this path were already fixed by #69821. I 
confirmed that in Breeze with trigger-ended tasks that retried and ran 
callbacks like the worker path.
   
   Before writing more code, I'd like your direction on the remaining gaps:
   
   1. **Metrics** (e.g. `ti.finish`): these seem to be emitted only by the 
worker task runner. Is it acceptable to emit them from the trigger handler?
   2. **Listeners**: a parse-time guard blocks `end_from_trigger` when 
listeners exist. Would you prefer lifting the guard and calling the hooks from 
the handler, or keeping it as a documented limitation?
   3. **Asset outlets**: static `task.outlets` could be registered from the 
handler, but dynamic outlet events can't be recovered. Worth doing, or should 
the docs recommend `end_from_trigger=False` for tasks with outlets?
   4. **Other differences**: `on_skipped_callback`, Dag `fail_fast` and the 
audit Log row are also skipped on this path. Fix them here or leave them?
   5. **Design**: the scheduler's failure path ends in 
`TaskInstance.handle_failure`, while this handler patches in the pieces one by 
one. Would you rather route the failure case through `handle_failure`?
   
   Separately, the `RuntimeError` for `relative_fileloc is None` in 
`_submit_callback_if_necessary` sits outside its try/except and escapes 
`submit_event`. Is that worth its own issue?
   
   I'll send a small docs PR for the `TaskFailureEvent` / `TaskFailedEvent` 
typo separately.


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