Open
Description
TCP Transport RuntimeError with Python 3.13 + uvloop
Summary
uvloop is causing RuntimeError: unable to perform operation on <TCPTransport closed=True>
errors when used with Python 3.13. Switching to --loop asyncio
fixes the issue.
Environment
- Python: 3.13.3
- uvloop: (latest)
- Starlette: 0.46.2
- FastAPI: 0.115.14
Reproduction
- Use Python 3.13
- Run uvicorn with
--loop uvloop
- Make concurrent HTTP requests (e.g., browser loading static files)
- Client disconnects/refreshes during response
Workaround
Use --loop asyncio
instead of uvloop.
Expected
uvloop should handle closed connections gracefully like asyncio does.
Edit
I had a stray uvicorn process that had wracked up 9hrs of CPU time, this could potentially be the issue?
Metadata
Metadata
Assignees
Labels
No labels