#729·asyncpg

Something is setting the result on a completed task?

Author: ale-ddCreated Mar 29, 2021Updated Aug 4, 2026
  • asyncpg version: 0.22.0+ (at commit 075114c195e9eb4e81c8365d81540beefb46065c)
  • PostgreSQL version: CockroachDB v20.2.3
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce the issue with a local PostgreSQL install?: not a SaaS, we do our own deployments
  • Python version: Python 3.9.1
  • Platform: Linux
  • Do you use pgbouncer?: no
  • Did you install asyncpg with pip?: yes but from the git repo, to get the latest fixes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and uvloop?: for now I've seen this under uvloop
fatal
protocol: <asyncpg.connect_utils.TLSUpgradeProto object at 0x7f3f453f9340>
transport: <TCPTransport closed=False reading=False 0x556958f834a0>
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 829, in uvloop.loop.__uv_stream_on_read_impl
  File "/root/aurora-extract/src/asyncpg/asyncpg/connect_utils.py", line 516, in data_received
    self.on_data.set_result(True)
asyncio.exceptions.InvalidStateError: invalid state```