MagicStack / MagicStack/asyncpg
Trying to debug `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 8.1k
- Forks
- 468
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
- 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?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, asyncpg/protocol/protocol.pyx in der Umgebung von Zeile 664 zu lesen, und verfolge dann den im Bericht beschriebenen pool.acquire-Kontext sowie die aufeinanderfolgenden Aufrufe von fetchrow, fetchval und fetch. Versuche, das Verhalten unter asyncio und uvloop auf ein reproduzierbares Beispiel zu reduzieren. Als abgeschlossen gilt die Identifizierung der kollidierenden Operation oder die Dokumentation der fehlenden Reproduktionsdetails, die zur Diagnose benötigt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- postgresql, python
- Bereich
- backend, databases
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100