MagicStack / MagicStack/asyncpg
cannot switch to state 15; another operation (2) 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.23.0
* **PostgreSQL version**: Aurora PostgreSQL 10.14
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**: RDS Aurora (and hard to repro)
* **Python version**: 3.9
* **Platform**: Linux
* **Do you use pgbouncer?**: no
* **Did you install asyncpg with pip?**: pip3.9 install --user
* **If you built asyncpg locally, which version of Cython did you use?**:
* **Can the issue be reproduced under both asyncio and [uvloop](https://github.com/magicstack/uvloop)?**: repro'd with uvloop
```
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 792, in __aexit__
await self.pool.release(con)
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 666, in release
return await asyncio.shield(ch.release(timeout))
File "/usr/lib/python3.9/asyncio/futures.py", line 284, in __await__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
future.result()
File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "/usr/lib/python3.9/asyncio/tasks.py", line 256, in __step
result = coro.send(None)
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 218, in release
raise ex
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 208, in release
await self._con.reset(timeout=budget)
File "/root/.local/lib/python3.9/site-packages/asyncpg/connection.py", line 1311, in reset
await self.execute(reset_query, timeout=timeout)
File "lib/common.py", line 164, in execute
return await self._with_logger(super(PSQLLoggerMixin, self).execute)(*args, **kwargs)
File "lib/common.py", line 119, in wrapper
ret_val = await func(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/asyncpg/connection.py", line 297, in execute
return await self._protocol.query(query, timeout)
File "asyncpg/protocol/protocol.pyx", line 338, in query
File "/usr/lib/python3.9/asyncio/futures.py", line 287, in __await__
return self.result() # May raise too.
File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "asyncpg/protocol/protocol.pyx", line 331, in asyncpg.protocol.protocol.BaseProtocol.query
File "asyncpg/protocol/coreproto.pyx", line 1061, in asyncpg.protocol.protocol.CoreProtocol._simple_query
File "asyncpg/protocol/coreproto.pyx", line 768, in asyncpg.protocol.protocol.CoreProtocol._set_state
asyncpg.exceptions._base.InternalClientError: cannot switch to state 15; another operation (2) is in progress
```
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 mit asyncpg/pool.py rund um release, asyncpg/connection.py rund um reset und asyncpg/protocol/coreproto.pyx rund um _set_state. Prüfen Sie den Traceback und untersuchen Sie den Pfad für gleichzeitige Operationen. Beachten Sie dabei, dass der Fehler schwer reproduzierbar ist und mit uvloop und Aurora PostgreSQL beobachtet wurde. Als abgeschlossen gilt die Aufgabe, wenn die Ursache reproduzierbar oder erklärt ist und der Fehler beim Zustandswechsel behoben wurde, ohne die Freigabe der Verbindung zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- postgresql, python
- Bereich
- 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