This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 264a870  Filter out SSL shutdown timeout errors from asyncio in 
Hypercorn
264a870 is described below

commit 264a870871aa0b7e0ce1292764f9be1da61a7554
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jan 27 20:30:58 2026 +0000

    Filter out SSL shutdown timeout errors from asyncio in Hypercorn
---
 atr/server.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/atr/server.py b/atr/server.py
index 398f691..28bb1df 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -21,6 +21,7 @@ import asyncio
 import contextlib
 import datetime
 import fcntl
+import logging
 import multiprocessing
 import os
 import pathlib
@@ -119,6 +120,20 @@ class ApiOnlyOpenAPIProvider(quart_schema.OpenAPIProvider):
                 yield rule
 
 
+class SSLShutdownFilter(logging.Filter):
+    def filter(self, record: logging.LogRecord) -> bool:
+        if not record.exc_info:
+            return True
+        exc = record.exc_info[1]
+        if not isinstance(exc, TimeoutError):
+            return True
+        if not exc.args:
+            return True
+        if exc.args[0] == "SSL shutdown timed out":
+            return False
+        return True
+
+
 def _app_create_base(app_config: type[config.AppConfig]) -> base.QuartApp:
     """Create the base Quart application."""
     if asfquart.construct is ...:
@@ -335,6 +350,10 @@ def _app_setup_logging(app: base.QuartApp, config_mode: 
config.Mode, app_config:
 
     loggers.configure_structlog(shared_processors)
 
+    # Ignore SSL shutdown timeout errors from asyncio in Hypercorn
+    ssl_shutdown_filter = SSLShutdownFilter()
+    logging.getLogger("asyncio").addFilter(ssl_shutdown_filter)
+
     # Audit logger - JSON to dedicated file via queue
     audit_listener = loggers.setup_dedicated_file_logger(
         "atr.storage.audit",


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

Reply via email to