Skip to content

Conversation

@zzstoatzz
Copy link
Collaborator

Summary

  • Fixes worker healthcheck breaking subprocess spawning when uvloop is installed (via uvicorn[standard])
  • Adds loop="asyncio" to uvicorn config to prevent uvloop from setting a global event loop policy
  • Updates settings access to use get_current_settings() pattern

Root cause

uvicorn ≤0.35.0 with uvloop installed calls uvloop_setup() which sets a global uvloop.EventLoopPolicy(). When the worker then tries to spawn a subprocess using a SelectorEventLoop, it fails because uvloop's policy doesn't implement get_child_watcher().

Test plan

  • Verify healthcheck still works with --with-healthcheck
  • Verify subprocesses can be spawned when uvloop is installed

Fixes #19658

🤖 Generated with Claude Code

… healthcheck

uvicorn ≤0.35.0 with uvloop installed sets a global uvloop.EventLoopPolicy()
when starting, which breaks subprocess spawning when a SelectorEventLoop is
used (uvloop's policy doesn't implement get_child_watcher()).

This adds loop="asyncio" to the healthcheck uvicorn config to prevent this,
and updates settings access to use the new get_current_settings() pattern.

Fixes #19658

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions bot added the bug Something isn't working label Dec 5, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 5, 2025

CodSpeed Performance Report

Merging #19660 will not alter performance

Comparing fix-healthcheck-uvloop-policy (70e2e0f) with main (0731084)

Summary

✅ 2 untouched

@zzstoatzz zzstoatzz merged commit 5977b96 into main Dec 5, 2025
92 of 93 checks passed
@zzstoatzz zzstoatzz deleted the fix-healthcheck-uvloop-policy branch December 5, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workers with --with-healthcheck fail to spawn subprocesses when uvloop is installed

3 participants