seanghaeli opened a new issue, #77049:
URL: https://github.com/apache/airflow/issues/77049

   `TriggerRunner.run_trigger` 
(`airflow-core/src/airflow/jobs/triggerer_job_runner.py`) calls the trigger's 
`cleanup()` in its `finally` block inside `with suppress(Exception)`, so when 
`cleanup()` raises, nothing is logged. A trigger that fails to close a client, 
delete a temporary resource or release a lock leaves no trace in the trigger's 
log or the triggerer's, and its author has no way to find out. The 
`BaseTrigger.cleanup` docstring (`airflow-core/src/airflow/triggers/base.py`) 
documents this and asks authors to wrap their own code in try/except.
   
   `on_kill()`, a few lines above in the same method, is already handled the 
other way: its exception is logged as `on_kill() raised an exception` with the 
traceback.
   
   Suggestion: replace the `suppress(Exception)` with an `except Exception` 
that logs a warning with the traceback, like `on_kill()`, still without 
re-raising, and update the `cleanup()` docstring to match.
   
   This is small and self-contained, so it would make a good first issue.
   


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