MagicStack / MagicStack/asyncpg

Trying to debug `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`

Aperta
#537 7 commenti 6 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
8.1k
Fork
468
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

  • 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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo asyncpg/protocol/protocol.pyx intorno alla riga 664, quindi segui il contesto di pool.acquire e le chiamate sequenziali a fetchrow, fetchval e fetch descritte nel report. Prova a ridurre il comportamento a un esempio riproducibile con asyncio e uvloop. Il lavoro è concluso quando avrai identificato l’operazione in conflitto oppure documentato i dettagli mancanti per la riproduzione necessari a diagnosticarlo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
postgresql, python
Ambito
backend, databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.