TCP Transport RuntimeError with Python 3.13 + uvloop
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?
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 93.25%. Comparing base (2de9491) to head (1d2b6ac).
:warning: Report is 209 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2325 +/- ##
==========================================
- Coverage 93.61% 93.25% -0.36%
==========================================
Files 28 35 +7
Lines 3760 4613 +853
==========================================
+ Hits 3520 4302 +782
- Misses 240 311 +71
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I couldn't find any testing instructions anywhere. If you got some special testing standards, feel free to tell me and I will do so :)
Also I don't know why the coverage is failing, I assumed I simply needed to increase coverage by adding a test, but the CI is still failing. :thinking:
@selwin Sorry if you are not the right person to tag here.
But before I spend time on figuring out the coverage report issues, I thought it's better to ask if in principle this has a chance to be merged :)
Mind adding a note of this feature in docs? https://github.com/rq/rq/blob/2a37a9f090b67b8ae3ea589b100a06fdc0439e18/docs/docs/index.md?plain=1#L436
Mind adding a note of this feature in docs? https://github.com/rq/rq/blob/2a37a9f090b67b8ae3ea589b100a06fdc0439e18/docs/docs/index.md?plain=1#L436
Of course! Sorry forgot about that, I will do it once I have the time 👍