MagicStack / MagicStack/asyncpg
Trying to debug `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 8.1k
- 派生
- 468
- PR 合并指标
- 30 天内没有已合并 PR
描述
- asyncpg version: 0.20.1
- PostgreSQL version: 12
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: no - Python version: 3.7.5
- Platform: OS X
- Do you use pgbouncer?: no
- Did you install asyncpg with pip?: yes
- If you built asyncpg locally, which version of Cython did you use?: -
- Can the issue be reproduced under both asyncio and
uvloop?: yes
Hi!
I'm trying to debug an issue that I have with errors like asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress from this line: https://github.com/MagicStack/asyncpg/blob/dcef29804095990f25178b642b920f3fbcb4ca22/asyncpg/protocol/protocol.pyx#L664
I am trying to understand where I could have gone wrong. So, I would like to ask the following preliminary question:
Suppose my code interacts with asyncpg only through a pool, and only using context managers:
async with pool.acquire() as connection:
...
I also do not share the connection object around. On it, I use the methods fetchrow, fetchval and fetch. They are used sequentially from the same asyncio "thread" (for lack of better word). That is to say, they are never called in parallel.
In this setup, I would think that the error cannot perform operation: another operation is in progress never shows up, but it does. Am I missing something?
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先阅读 asyncpg/protocol/protocol.pyx 第 664 行附近的代码,然后跟踪报告中描述的 pool.acquire 上下文以及依次执行的 fetchrow、fetchval 和 fetch 调用。尝试在 asyncio 和 uvloop 下将该行为缩减为一个可复现示例。完成的标准是确定发生冲突的操作,或记录诊断该问题所需但缺失的复现细节。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, python
- 领域
- backend, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100