Skip to content

Connection not timing out #9584

Closed as not planned
Closed as not planned
@Azmisov

Description

@Azmisov

Describe the bug

I have a request which is hanging and never times out. It is occurring during connection to an IP which never responds; e.g. ping ip will hang with 100% packet loss. I am able to reproduce it 100% in a larger codebase running in a Docker instance. I'm not able to reproduce it running locally, so I'll play around some more to see if I can put together a minimal example.

To Reproduce

async def test(ip):
    addr_infos = [(
        AddressFamily.AF_INET,
        SocketKind.SOCK_STREAM,
        6, '', (ip, 80)
    )]
    loop = asyncio.get_running_loop()
    print("Loop:", loop)
    try:
        async with ceil_timeout(1, ceil_threshold=5):
            sock = await aiohappyeyeballs.start_connection(
                addr_infos=addr_infos,
                local_addr_infos=None,
                happy_eyeballs_delay=0.25,
                interleave=None,
                loop=loop,
            )
            print("Connected:", sock)
    except Exception as e:
        print("Exception:", type(e))

Expected behavior

Should throw an exception

Logs/tracebacks

Loop: <_UnixSelectorEventLoop running=True closed=False debug=False>

Python Version

3.12

aiohttp Version

3.10.10

multidict Version

6.1.0

propcache Version

0.2.0

yarl Version

1.17.0

OS

Debian bookworm

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalebugneeds-infoIssue is lacking sufficient information and will be closed if not providedreproducer: missingThis PR or issue lacks code, which reproduce the problem described or clearly understandable STR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions