Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio.open_connection happy_eyeballs_delay leaves refcycles with exception tracebacks #124858

Open
graingert opened this issue Oct 1, 2024 · 0 comments
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@graingert
Copy link
Contributor

graingert commented Oct 1, 2024

Bug report

Bug description:

import asyncio
import gc
import objgraph
import weakref

async def amain():
    exc = None
    try:
        await asyncio.open_connection(
            host="localhost", port=8080, happy_eyeballs_delay=0.25
        )
    except* OSError as excs:
        exc = excs.exceptions[0]
    assert exc is not None
    print(gc.get_referrers(exc))

asyncio.run(amain())

should be empty but you get a bunch of exceptions lists:

[[ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 8080)")], [ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 8080)")]]

CPython versions tested on:

3.12, 3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

@graingert graingert added the type-bug An unexpected behavior, bug, or error label Oct 1, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 2, 2024
(cherry picked from commit c066bf5)

Co-authored-by: Thomas Grainger <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 2, 2024
(cherry picked from commit c066bf5)

Co-authored-by: Thomas Grainger <[email protected]>
willingc pushed a commit that referenced this issue Oct 23, 2024
gh-124858: fix happy eyeballs refcyles (GH-124859)
(cherry picked from commit c066bf5)

Co-authored-by: Thomas Grainger <[email protected]>
willingc pushed a commit that referenced this issue Oct 23, 2024
gh-124858: fix happy eyeballs refcyles (GH-124859)
(cherry picked from commit c066bf5)

Co-authored-by: Thomas Grainger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
Status: Todo
Development

No branches or pull requests

2 participants