Skip to content

fix: pin uvicorn loop to asyncio (loop=auto silently re-enables uvloop)#135

Merged
ServerSideHannes merged 1 commit into
mainfrom
fix/pin-asyncio-loop
Jul 19, 2026
Merged

fix: pin uvicorn loop to asyncio (loop=auto silently re-enables uvloop)#135
ServerSideHannes merged 1 commit into
mainfrom
fix/pin-asyncio-loop

Conversation

@ServerSideHannes

Copy link
Copy Markdown
Owner

Problem

#134 removed our uvloop.install() call, but pods still crashed with the identical libuv uv__io_poll abort (2026-07-18 10:18 UTC, faulthandler trace shows uvloop frames on a 2026.7.22 pod). Root cause: uvicorn's default loop="auto" installs uvloop itself whenever the package is importable — the #134 gate was a no-op in practice.

Change

  • Pass loop="asyncio" in the uvicorn config unless S3PROXY_UVLOOP=1 (which uses loop="auto").
  • Log the actually-running event loop class at startup (event_loop=... on the Starting line) so deploys can be verified against the runtime, not against which code path printed a log line.
  • Tests assert the uvicorn config pins the loop by default and only relaxes to auto on explicit opt-in.

@ServerSideHannes
ServerSideHannes merged commit 7deb26e into main Jul 19, 2026
11 checks passed
@ServerSideHannes
ServerSideHannes deleted the fix/pin-asyncio-loop branch July 19, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant