Sun-Wukhan opened a new pull request, #77066:
URL: https://github.com/apache/airflow/pull/77066

   Trigger cleanup failures are currently invisible: 
`TriggerRunner.run_trigger` wraps `await trigger.cleanup()` in 
`suppress(Exception)`, so a failing cleanup (an unclosed client, a leaked temp 
resource or lock) leaves no trace in any log.
   
   This logs the exception instead, mirroring how `on_kill()` failures are 
already handled in the same method. The exception is caught and logged as a 
warning with the traceback, and is still not raised, so trigger completion 
behaviour is unchanged, and `asyncio.CancelledError` still propagates exactly 
as it did under `suppress(Exception)`. The `BaseTrigger.cleanup()` docstring is 
updated to say that exceptions are logged by the triggerer, and a newsfragment 
is added.
   
   Tests: adds `test_run_trigger_cleanup_exception_is_logged` in 
`airflow-core/tests/unit/jobs/test_triggerer_job.py`, where a trigger whose 
`cleanup()` raises still completes normally and the warning is captured in the 
structlog output. I could not run the test locally: the uv workspace resolves 
every workspace member (including all providers) even for a single core test 
file, which needs the full monorepo checkout rather than the sparse one used 
here. The changed files compile and follow the existing patterns in the same 
files; CI is the check for the test.
   
   closes: #77049
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below)
   
   Generated-by: Muse 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