TCP Transport RuntimeError with Python 3.13 + uvloop
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start by reproducing the failure with Python 3.13.3, uvloop, and uvicorn using concurrent requests and a client disconnect or refresh; compare it with --loop asyncio. Trace the TCPTransport closed=True RuntimeError and account for the reported stray uvicorn process. Done means the uvloop configuration handles closed connections without this error under the reproduction.
Written by the indexing model from the issue text.
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?
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 615
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicStack/uvloop
-
License not clear Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#759 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#741 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#702 · 8 comments · 9 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MagicStack/uvloop#766 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
MagicStack/uvloop#765 ·
All issues in MagicStack/uvloop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-mgmt#28113 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
canonical/postgresql-watcher-operator#110 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EleutherAI/lm-evaluation-harness#4201 ·