MagicStack / MagicStack/asyncpg

Something is setting the result on a completed task?

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

还没有人认领这个 Issue。

主要语言
Python
星标
8.1k
派生
468
PR 合并指标
30 天内没有已合并 PR

描述

  • asyncpg version: 0.22.0+ (at commit 075114c195e9eb4e81c8365d81540beefb46065c)
  • PostgreSQL version: CockroachDB v20.2.3
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    : not a SaaS, we do our own deployments
  • Python version: Python 3.9.1
  • Platform: Linux
  • Do you use pgbouncer?: no
  • Did you install asyncpg with pip?: yes but from the git repo, to get the latest fixes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : for now I've seen this under uvloop
protocol: <asyncpg.connect_utils.TLSUpgradeProto object at 0x7f3f453f9340>
transport: <TCPTransport closed=False reading=False 0x556958f834a0>
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 829, in uvloop.loop.__uv_stream_on_read_impl
  File "/root/aurora-extract/src/asyncpg/asyncpg/connect_utils.py", line 516, in data_received
    self.on_data.set_result(True)
asyncio.exceptions.InvalidStateError: invalid state```

贡献指南

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

从这里开始

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

调研方向

从 asyncpg/connect_utils.py:516 开始,这里 TLSUpgradeProto.data_received 调用 self.on_data.set_result(True),并追踪该 task 在 uvloop 下何时完成。如果可能,使用 CockroachDB 重现报告的 InvalidStateError;完成的标准是 TLS upgrade 不再尝试为一个已经完成的 task 设置结果。

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

评估

技术栈
postgresql, python
领域
backend, databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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