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 3a9c174  Use uvloop to avoid APPLICATION_DATA_AFTER_CLOSE_NOTIFY errors
3a9c174 is described below

commit 3a9c1742e420a181d31aabd6c47cf316da55ede3
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Dec 23 15:22:13 2025 +0000

    Use uvloop to avoid APPLICATION_DATA_AFTER_CLOSE_NOTIFY errors
---
 Makefile       |  4 ++--
 atr/server.py  |  5 -----
 pyproject.toml |  2 +-
 start-atr.sh   |  2 +-
 start-dev.sh   |  2 +-
 uv.lock        | 25 ++++++++++++++++++++++---
 6 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 3172f7e..2089f6b 100644
--- a/Makefile
+++ b/Makefile
@@ -103,13 +103,13 @@ run-playwright-slow:
 serve:
        SSH_HOST=127.0.0.1 uv run --frozen hypercorn --bind $(BIND) \
          --keyfile localhost.apache.org+3-key.pem --certfile 
localhost.apache.org+3.pem \
-         atr.server:app --debug --reload
+         atr.server:app --debug --reload --worker-class uvloop
 
 serve-local:
        APP_HOST=localhost.apache.org:8080 SECRET_KEY=insecure-local-key \
          ALLOW_TESTS=1 SSH_HOST=127.0.0.1 uv run --frozen hypercorn --bind 
$(BIND) \
          --keyfile localhost.apache.org+3-key.pem --certfile 
localhost.apache.org+3.pem \
-         atr.server:app --debug --reload
+         atr.server:app --debug --reload --worker-class uvloop
 
 sync:
        uv sync --frozen --no-dev
diff --git a/atr/server.py b/atr/server.py
index 233cf4b..88962c2 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -70,11 +70,6 @@ class ApiOnlyOpenAPIProvider(quart_schema.OpenAPIProvider):
                 yield rule
 
 
-# FIXME: when running in SSL mode, you will receive these exceptions upon 
termination at times:
-#        ssl.SSLError: [SSL: APPLICATION_DATA_AFTER_CLOSE_NOTIFY] application 
data after close notify (_ssl.c:2706)
-#        related ticket: https://github.com/pgjones/hypercorn/issues/261
-#        in production, we actually do not need SSL mode as SSL termination is 
handled by the apache reverse proxy.
-#        the tooling-agenda app runs without SSL on agenda-test in a similar 
setup and it works fine.
 def main() -> None:
     """Quart debug server"""
     global app
diff --git a/pyproject.toml b/pyproject.toml
index e183ff8..cdd80d5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -31,7 +31,7 @@ dependencies = [
   "gitignore-parser (>=0.1.12,<0.2.0)",
   "greenlet>=3.1.1,<4.0.0",
   "htpy (>=25.7.0,<26.0.0)",
-  "hypercorn~=0.17",
+  "hypercorn[uvloop]~=0.17",
   "ldap3 (==2.10.2rc2)",
   "packaging>=25.0",
   "pgpy>=0.6.0",
diff --git a/start-atr.sh b/start-atr.sh
index 734d8cc..3f2ca33 100755
--- a/start-atr.sh
+++ b/start-atr.sh
@@ -12,5 +12,5 @@ then
 fi
 
 echo "Starting hypercorn on ${BIND}" >> /opt/atr/state/hypercorn.log
-exec hypercorn --bind "${BIND}" \
+exec hypercorn --worker-class uvloop --bind "${BIND}" \
   --keyfile key.pem --certfile cert.pem atr.server:app >> 
/opt/atr/state/hypercorn.log 2>&1
diff --git a/start-dev.sh b/start-dev.sh
index ae7a915..e5da95e 100755
--- a/start-dev.sh
+++ b/start-dev.sh
@@ -12,5 +12,5 @@ then
 fi
 
 echo "Starting hypercorn on ${BIND}" >> /opt/atr/state/hypercorn.log
-exec hypercorn --reload --bind "${BIND}" \
+exec hypercorn --worker-class uvloop --reload --bind "${BIND}" \
   --keyfile key.pem --certfile cert.pem atr.server:app | tee 
/opt/atr/state/hypercorn.log 2>&1
diff --git a/uv.lock b/uv.lock
index 9e12959..d376113 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3,7 +3,7 @@ revision = 3
 requires-python = "==3.13.*"
 
 [options]
-exclude-newer = "2025-12-22T14:59:46Z"
+exclude-newer = "2025-12-23T15:19:09Z"
 
 [[package]]
 name = "aiofiles"
@@ -728,6 +728,11 @@ wheels = [
     { url = 
"https://files.pythonhosted.org/packages/93/35/850277d1b17b206bd10874c8a9a3f52e059452fb49bb0d22cbb908f6038b/hypercorn-0.18.0-py3-none-any.whl";,
 hash = 
"sha256:225e268f2c1c2f28f6d8f6db8f40cb8c992963610c5725e13ccfcddccb24b1cd", size 
= 61640, upload-time = "2025-11-08T13:54:03.202Z" },
 ]
 
+[package.optional-dependencies]
+uvloop = [
+    { name = "uvloop" },
+]
+
 [[package]]
 name = "hyperframe"
 version = "6.1.0"
@@ -1822,7 +1827,7 @@ dependencies = [
     { name = "gitignore-parser" },
     { name = "greenlet" },
     { name = "htpy" },
-    { name = "hypercorn" },
+    { name = "hypercorn", extra = ["uvloop"] },
     { name = "ldap3" },
     { name = "packaging" },
     { name = "pgpy" },
@@ -1881,7 +1886,7 @@ requires-dist = [
     { name = "gitignore-parser", specifier = ">=0.1.12,<0.2.0" },
     { name = "greenlet", specifier = ">=3.1.1,<4.0.0" },
     { name = "htpy", specifier = ">=25.7.0,<26.0.0" },
-    { name = "hypercorn", specifier = "~=0.17" },
+    { name = "hypercorn", extras = ["uvloop"], specifier = "~=0.17" },
     { name = "ldap3", specifier = "==2.10.2rc2" },
     { name = "packaging", specifier = ">=25.0" },
     { name = "pgpy", specifier = ">=0.6.0" },
@@ -1986,6 +1991,20 @@ wheels = [
     { url = 
"https://files.pythonhosted.org/packages/6d/b9/4095b668ea3678bf6a0af005527f39de12fb026516fb3df17495a733b7f8/urllib3-2.6.2-py3-none-any.whl";,
 hash = 
"sha256:ec21cddfe7724fc7cb4ba4bea7aa8e2ef36f607a4bab81aa6ce42a13dc3f03dd", size 
= 131182, upload-time = "2025-12-11T15:56:38.584Z" },
 ]
 
+[[package]]
+name = "uvloop"
+version = "0.22.1"
+source = { registry = "https://pypi.org/simple"; }
+sdist = { url = 
"https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz";,
 hash = 
"sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size 
= 2443250, upload-time = "2025-10-16T22:17:19.342Z" }
+wheels = [
+    { url = 
"https://files.pythonhosted.org/packages/89/8c/182a2a593195bfd39842ea68ebc084e20c850806117213f5a299dfc513d9/uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl";,
 hash = 
"sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705", size 
= 1358611, upload-time = "2025-10-16T22:16:36.833Z" },
+    { url = 
"https://files.pythonhosted.org/packages/d2/14/e301ee96a6dc95224b6f1162cd3312f6d1217be3907b79173b06785f2fe7/uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl";,
 hash = 
"sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8", size 
= 751811, upload-time = "2025-10-16T22:16:38.275Z" },
+    { url = 
"https://files.pythonhosted.org/packages/b7/02/654426ce265ac19e2980bfd9ea6590ca96a56f10c76e63801a2df01c0486/uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl";,
 hash = 
"sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d", size 
= 4288562, upload-time = "2025-10-16T22:16:39.375Z" },
+    { url = 
"https://files.pythonhosted.org/packages/15/c0/0be24758891ef825f2065cd5db8741aaddabe3e248ee6acc5e8a80f04005/uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl";,
 hash = 
"sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e", size 
= 4366890, upload-time = "2025-10-16T22:16:40.547Z" },
+    { url = 
"https://files.pythonhosted.org/packages/d2/53/8369e5219a5855869bcee5f4d317f6da0e2c669aecf0ef7d371e3d084449/uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl";,
 hash = 
"sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e", size 
= 4119472, upload-time = "2025-10-16T22:16:41.694Z" },
+    { url = 
"https://files.pythonhosted.org/packages/f8/ba/d69adbe699b768f6b29a5eec7b47dd610bd17a69de51b251126a801369ea/uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl";,
 hash = 
"sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad", size 
= 4239051, upload-time = "2025-10-16T22:16:43.224Z" },
+]
+
 [[package]]
 name = "virtualenv"
 version = "20.35.4"


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

Reply via email to