MagicStack / MagicStack/asyncpg
Trying to debug `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 8.1k
- Forks
- 469
- Merge moyen
- 18 min
- PR mergées (30 j)
- 4
Description
- 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?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par lire asyncpg/protocol/protocol.pyx autour de la ligne 664, puis suivez le contexte de pool.acquire et les appels séquentiels à fetchrow, fetchval et fetch décrits dans le rapport. Essayez de réduire le comportement à un exemple reproductible avec asyncio et uvloop. Le travail est terminé lorsque vous avez identifié l’opération en conflit ou documenté les détails de reproduction manquants nécessaires pour établir le diagnostic.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- postgresql, python
- Domaine
- backend, databases
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100