MagicStack / MagicStack/asyncpg
Await connection in debugpy
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.27.0
- PostgreSQL version: 15.1
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: - Python version: 3.11
- Platform: starlite
- Do you use pgbouncer?: no
- Did you install asyncpg with pip?: poetry
- If you built asyncpg locally, which version of Cython did you use?: n/a
- Can the issue be reproduced under both asyncio and
uvloop?: not sure
So I am using debugpy for debugging in vscode. Essentially this: python -m debugpy --listen 0.0.0.0:5678 ./myscript.py
I am using asyncpg + sqlalchemy. Specifically an AsyncSession
When I set a breakpoint and use the debug console I can normally await async functions.
But when I do this on an async query I get this error:
app_dev | Traceback (most recent call last):
app_dev | File "/usr/local/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 755, in _start_transaction
app_dev | await self._transaction.start()
app_dev | File "/usr/local/lib/python3.11/site-packages/asyncpg/transaction.py", line 138, in start
app_dev | await self._connection.execute(query)
app_dev | File "/usr/local/lib/python3.11/site-packages/asyncpg/connection.py", line 317, in execute
app_dev | return await self._protocol.query(query, timeout)
app_dev | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app_dev | File "asyncpg/protocol/protocol.pyx", line 323, in query
app_dev | File "asyncpg/protocol/protocol.pyx", line 707, in asyncpg.protocol.protocol.BaseProtocol._check_state
app_dev | asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress
Is there a way I can await async queries in the debug console?
Please let me know if this is a sqlAlchemy issue.
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
Beginnen Sie damit, den debugpy-Befehl mit Python 3.11, asyncpg 0.27.0, PostgreSQL 15.1 und SQLAlchemy AsyncSession nachzustellen, und untersuchen Sie anschließend, wo der Fehler bei gleichzeitigen Operationen seinen Ursprung hat. Ermitteln Sie, ob das Verhalten zu asyncpg, SQLAlchemy oder debugpy gehört; abgeschlossen ist die Aufgabe erst mit einer bestätigten Behebung oder einer klar dokumentierten Lösung.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- postgresql, python, sqlalchemy, vscode
- Bereich
- databases, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100