MagicStack / MagicStack/uvloop

RuntimeError: File descriptor 2877 is used by transport <TCPTransport closed=False reading=True 0x55b8dc9baa90>

未关闭
#653 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Cython
星标
11.9k
派生
616
PR 合并指标
30 天内没有已合并 PR

描述

In our service we had aiohttp==3.8.5 and upgraded aiohttp to 3.10.5 version. That is all. In production now we have issues like issue below.
Maybe i should to write issue to another libs, tell me about it if so, or maybe you have your own fix then tell me uvloop version i need to upgrade in my service.

traceback:

RuntimeError: File descriptor 2877 is used by transport <TCPTransport closed=False reading=True 0x55b8dc9baa90>
  File "our_service/app/client.py", line 204, in get_recommendations
    async with self._session.get(
  File "aiohttp/client.py", line 1353, in __aenter__
    self._resp = await self._coro
  File "aiohttp/client.py", line 657, in _request
    conn = await self._connector.connect(
  File "aiohttp/connector.py", line 564, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "aiohttp/connector.py", line 975, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "aiohttp/connector.py", line 1319, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "aiohttp/connector.py", line 1073, in _wrap_create_connection
    sock = await aiohappyeyeballs.start_connection(
  File "aiohappyeyeballs/impl.py", line 104, in start_connection
    raise first_exception
  File "aiohappyeyeballs/impl.py", line 82, in start_connection
    sock = await _connect_sock(
  File "aiohappyeyeballs/impl.py", line 174, in _connect_sock
    await loop.sock_connect(sock, address)
  File "uvloop/loop.pyx", line 2631, in sock_connect
    fut = self._sock_connect(sock, address)
  File "uvloop/loop.pyx", line 1089, in uvloop.loop.Loop._sock_connect
    self._add_writer(sock, handle)
  File "uvloop/loop.pyx", line 837, in uvloop.loop.Loop._add_writer
    self._ensure_fd_no_transport(fd)
  File "uvloop/loop.pyx", line 764, in uvloop.loop.Loop._ensure_fd_no_transport
    raise RuntimeError(

python version:
Python 3.10.15

os info:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

other installed libs:
aiohttp==3.10.5
aiohttp_traversal==0.11.0
aiojobs==1.2.0
asyncpg==0.29.0
orjson==3.9.10
uvloop==0.19.0
yarl==1.12.1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 uvloop/loop.pyx 中的 traceback 入口开始,尤其是 _ensure_fd_no_transport 和 _add_writer,然后针对报告的依赖版本将它们与 aiohttp/connector.py 和 aiohappyeyeballs/impl.py 进行比较。使用 Debian 12 上的 Python 3.10.15,以及 uvloop 0.19.0 和 aiohttp 3.10.5,重现 file-descriptor 冲突;完成的标准是确定一个可重现的原因,并提供回归测试或有文档记录的兼容性修复。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。