Skip to content

Something is setting the result on a completed task? #729

Open
@ale-dd

Description

@ale-dd
  • asyncpg version: 0.22.0+ (at commit 075114c)
  • 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
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```

Activity

mecampbellsoup

mecampbellsoup commented on Jan 31, 2023

@mecampbellsoup

Also seeing this, and also under uvloop.

added a commit that references this issue on Jan 30, 2024
087f79f
added 2 commits that reference this issue on Feb 1, 2024
78d86da
50bb192
w-miller

w-miller commented on Feb 2, 2024

@w-miller

I've created a PR to fix this

AndrewJackson2020

AndrewJackson2020 commented on Apr 25, 2025

@AndrewJackson2020
Contributor

Encountered this issue as well. Would be nice to see #1117 or another fix merged.

Jdyn

Jdyn commented on Jul 7, 2025

@Jdyn

Encountering this as well, is there any particular application pattern that could cause this to occur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @mecampbellsoup@w-miller@Jdyn@ale-dd@AndrewJackson2020

      Issue actions

        Something is setting the result on a completed task? · Issue #729 · MagicStack/asyncpg