The GitHub Actions job "Tests (AMD)" on 
airflow.git/google-stackdriver-handler-exception-handling has succeeded.
Run started by GitHub user potiuk (triggered by potiuk).

Head commit for run:
36040bc364b7acb79636c872f9b7828e7131d966 / Jarek Potiuk <[email protected]>
google: harden Stackdriver handler against Cloud Logging failures

Three failure modes in ``StackdriverTaskHandler`` exposed internal
details or broke shutdown:

1. ``read()`` did not wrap ``_read_logs()``. When Cloud Logging was
   unavailable, gRPC errors propagated as HTTP 500 from the log
   viewer instead of degrading gracefully (F-011).
2. gRPC errors from ``list_log_entries`` carry project IDs, resource
   names, and service-account info in their ``__str__``, and were
   forwarded into the user-visible error response (F-010).
3. ``close()`` called ``self._transport.flush()`` without exception
   handling. A failed flush during shutdown raised through stdlib's
   logging machinery, which does not handle exceptions from
   ``Handler.close()`` gracefully (F-013).

Wrap ``_read_logs()`` in ``read()`` with a try/except that surfaces a
short, generic user-facing message ("Cloud Logging is currently
unavailable.") and writes the full traceback to the handler's own
``_logger``. The outer guard catches the gRPC exceptions before they
reach the user, so F-010's leakage path is closed without adding a
second swallow inside ``_read_single_logs_page``.

Wrap ``_transport.flush()`` in ``close()`` with a try/except that
prints to stderr (since logging itself may be shutting down) so the
shutdown chain continues even when Cloud Logging is unreachable.

Report URL: https://github.com/apache/airflow/actions/runs/26423006628

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to