asyncpg.exceptions._base.InterfaceError: cannot call Connection.fetch(): connection has been released back to the pool
まだ誰も着手していません。
評価
- 難易度
- 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
- フォーク
- 469
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 14
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MagicStack/asyncpg のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MagicStack/asyncpg#1357 · コメント 1 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
MagicStack/asyncpg#1342 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
MagicStack/asyncpg#1340 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 28/100
MagicStack/asyncpg#1337 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
MagicStack/asyncpg#1330 · コメント 1 件 ·
MagicStack/asyncpg の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·