asyncpg.exceptions._base.InterfaceError: cannot call Connection.fetch(): connection has been released back to the pool
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 20/100
研究方向
先從 issue 中 Sanic 和 tortoise-orm 關於請求處理器與背景工作之間的範例開始,接著追蹤螢幕截圖中顯示的 pool.acquire 和 pool release 路徑。若可能,重現已釋放的 PoolConnectionProxy 錯誤,並判斷背景查詢是否在釋放後使用連線;完成的定義是已記錄原因,以及專案端修正或已確認的使用問題。
由索引模型根據 Issue 內容生成。
描述
- asyncpg version: 0.26.0
- PostgreSQL version: 12.0
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce : NO, from pg docker
the issue with a local PostgreSQL install?: YES, - Python version: Python 3.9.13
- Platform: MAC
- Do you use pgbouncer?: No
- Did you install asyncpg with pip?: From tortoise-orm
- If you built asyncpg locally, which version of Cython did you use?: No
- Can the issue be reproduced under both asyncio and
uvloop?: YES
I am using Sanic + tortoise-orm,
the test code as below:
when runs a query during the Request handler, it runs successfully
while runs in a background task, it report this error:
asyncpg.exceptions._base.InterfaceError: cannot call Connection.fetch(): connection has been released back to the pool
I found when the first time query, through the pool.acquire, got the right <PoolConnectionProxy <asyncpg.connection.Connection object at 0x7fd42102f9e0> 0x7fd3d018e550>
but when go to the background task query , the pool.acquire, got an "released" <PoolConnectionProxy [released] 0x7fd3d018e550>
I am confused how can I got an released PoolConnectionProxy from the same code
[query in the get Request method]

[query in the background task]

[the pool connection acquire method]

[the pool connection release method]

- 主要語言
- Python
- 星號
- 8.1k
- 分支
- 477
- 平均合併
- 1 天 7 小時
- 30 天內合併 PR
- 23
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MagicStack/asyncpg 的其他 Issue
-
Queries with more than 32767 arguments are refused, PostgreSQL accepts 65535可能已有人在做 @HardMax71 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 18/100
MagicStack/asyncpg#1390 ·
維護者通常 1 天內回覆
-
Failed BEGIN leaves Connection._top_xact set; every later transaction becomes a SAVEPOINT and fails with NoActiveSQLTransactionError可能已有人在做 @devtechedge 於 9 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 35/100
MagicStack/asyncpg#1386 ·
維護者通常 1 天內回覆
-
Connect call failed error doesn't distinguish port mismatch from "server not running"可能已有人在做 @aryansk 於 62 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 72/100
MagicStack/asyncpg#1342 ·
維護者通常 1 天內回覆
-
TypeError in asyncpg.connect() for specific parameters when values are not str enough可能已有人在做 @pranjalm37 於 64 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 56/100
MagicStack/asyncpg#1340 · 1 則留言 ·
維護者通常 1 天內回覆
-
setup.py relies on deprecated pkg_resources可能已有人在做 @jasonwbarnett 於 93 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 28/100
MagicStack/asyncpg#1337 · 1 則留言 ·
維護者通常 1 天內回覆
查看 MagicStack/asyncpg 的全部 Issue
相似的 Issue
-
bot-triaged module: LrScheduler module: optimizer triaged
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
documentation glm5 llm-model
難度 2/5 1-3 小時 新手友好度 78/100
vllm-project/vllm-ascend#19062 ·
維護者通常 1 天內回覆
-
author-page correction
難度 2/5 1-3 小時 新手友好度 68/100
acl-org/acl-anthology#10496 · 1 則留言 ·
維護者通常 1 天內回覆
-
Issue Type: Bug Report
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 76/100
SasanLabs/VulnerableApp#836 ·
維護者通常 1 天內回覆