jason810496 opened a new pull request, #67632: URL: https://github.com/apache/airflow/pull/67632
The ``finally`` block in ``HttpAccessLogMiddleware`` called ``logger.info()`` without exception protection. If ``logger.info()`` raised — broken handler, OOM in the formatter, downstream forwarder unavailable — and the original ``try`` block was already propagating an application exception, Python's ``finally``-replacement semantics would discard the original exception in favour of the logger's, so uvicorn never saw the real failure. Wrap the emit in ``contextlib.suppress(Exception)`` so logging failures never disrupt the application or mask the original exception. The HTTP response has already been sent to the client by the time we reach the log emit, so swallowing the logger failure costs nothing beyond a missing log line for that one request. (cherry picked from commit b66f4433e004fad81b66023bd8caccee55e6e4f7) -- 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]
