Skip to content

TCP Transport RuntimeError with Python 3.13 + uvloop #685

Open
@dylangroos

Description

@dylangroos

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

  1. Use Python 3.13
  2. Run uvicorn with --loop uvloop
  3. Make concurrent HTTP requests (e.g., browser loading static files)
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions