test: suppress ECONNABORTED in wait_for_rpc_connection on Windows #35350

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/connabort changing 1 files +4 −0
  1. ryanofsky commented at 7:25 PM on May 21, 2026: contributor

    Since bitcoin/bitcoin#33362, feature_bind_port_externalip.py auto-detects whether 1.1.1.5 is available by starting a node with -bind=1.1.1.5 and converting a bind failure into a skip. On Windows CI the address is not configured, so bitcoind exits as expected — but intermittently an RPC probe raises ConnectionAbortedError (WSAECONNABORTED/WinError 10053) while the process is shutting down, causing the test to fail rather than skip.

    Fix by treating ECONNABORTED the same as the other transient connection errors already suppressed during startup (ECONNRESET, ETIMEDOUT, ECONNREFUSED).

    Fixes #35343

  2. test: suppress ECONNABORTED in wait_for_rpc_connection on Windows
    Since bitcoin/bitcoin#33362, feature_bind_port_externalip.py runs in CI and
    auto-detects whether 1.1.1.5 is assigned by starting nodes with -bind=1.1.1.5,
    then converting a FailedToStartError containing "Unable to bind to" into a
    SkipTest. On Windows CI the address is not configured, so bitcoind fails as
    expected — but intermittently, while the process is shutting down, an RPC probe
    raises ConnectionAbortedError (WSAECONNABORTED/WinError 10053) before
    wait_for_rpc_connection() notices that the process has exited. That error was
    not in the suppressed set, so it escaped and the test failed instead of being
    skipped.
    
    The intermittency is a race on TCP connection timing. If the probe connects
    before the RPC port is listening, connect can fail with ECONNREFUSED. If the
    TCP connection is established but is then closed abortively during shutdown,
    the probe can see a connection-reset/aborted error instead. On POSIX systems
    this commonly shows up as ECONNRESET ("connection reset by peer"). Winsock
    also has WSAECONNABORTED for cases where an established connection is aborted
    locally or otherwise terminated due to a timeout/protocol failure, in addition
    to WSAECONNRESET for a reset by the remote side. This is why the
    Windows-specific error may need to be suppressed separately.
    
    Fix by treating ECONNABORTED identically to ECONNRESET, ETIMEDOUT, and
    ECONNREFUSED: retry the probe rather than raising.
    
    Fix was suggested by willcl-ark in
    https://github.com/bitcoin/bitcoin/issues/35343#issuecomment-4507329622
    
    Fixes #35343
    7209eb7790
  3. DrahtBot added the label Tests on May 21, 2026
  4. DrahtBot commented at 7:25 PM on May 21, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35350.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK willcl-ark, maflcko, hodlinator

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. willcl-ark approved
  6. willcl-ark commented at 7:48 PM on May 21, 2026: member

    utACK 7209eb77902a8bf170fd7fbf6ec2388fec77b115

    Can't test this myself, but the fix seems logical.

  7. maflcko commented at 7:50 PM on May 21, 2026: member

    lgtm ACK 7209eb77902a8bf170fd7fbf6ec2388fec77b115

  8. hodlinator approved
  9. hodlinator commented at 8:28 PM on May 21, 2026: contributor

    crACK 7209eb77902a8bf170fd7fbf6ec2388fec77b115

    Seems like a very plausible fix from inspecting the traceback in #35343. Comment on L381 is in line with the shutdown activity earlier in the log there too.

  10. sedited merged this on May 21, 2026
  11. sedited closed this on May 21, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-22 20:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me