Skip to content

ip-happy: do not set unnecessary timeout - #18768

Closed
icing wants to merge 8 commits into
curl:masterfrom
icing:ip-happy-timeout-fix
Closed

icing wants to merge 8 commits into
curl:masterfrom
icing:ip-happy-timeout-fix

Conversation

@icing

@icing icing commented Sep 29, 2025 •

Copy link
Copy Markdown
Contributor

When attempts on all addresses have been started, do no longer set any EXPIRE_HAPPY_EYEBALLS timeouts.

Add tracing feature timer to trace transfer related timers set/cleared. Add tracing in multi for event based timer updates.

Added pytest test_06_13 to check happy eyeballing against 3 unresponsive addresses and timer use. Improved tcp filter tracing to list the socket as well, so that several ongoing attempts can be easier differentiated.

refs #18767

@dscho dscho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix the problem I observed in microsoft/git#799 (comment), thank you so much!

I wonder whether there is any chance to add a regression test to prevent this bug from creeping in again?

@icing

icing commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

This seems to fix the problem I observed in microsoft/git#799 (comment), thank you so much!

I wonder whether there is any chance to add a regression test to prevent this bug from creeping in again?

Thought about it, but this is tricky. All operating systems besides Windows immediately fail a connection to a port no one is listening on. So, one needs an address that is guaranteed to go into the void everywhere...

@dscho

dscho commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

All operating systems besides Windows immediately fail a connection to a port no one is listening on.

It could be a test case that only runs on Windows, then? I mean, CI coverage of Windows is pretty good ;-)

dscho added a commit to git-for-windows/MINGW-packages that referenced this pull request Sep 29, 2025
In cURL v8.16.0, the behavior changed subtly: Timeouts were added even
in circumstances where cURL failed to connect and should have errored
out with the corresponding `CURLE_COULDNT_CONNECT` instead.

This commit back-ports the fix from
curl/curl#18768.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/MINGW-packages that referenced this pull request Sep 29, 2025
In cURL v8.16.0, the behavior changed subtly: Timeouts were added even
in circumstances where cURL failed to connect and should have errored
out with the corresponding `CURLE_COULDNT_CONNECT` instead.

This commit back-ports the fix from
curl/curl#18768.

Signed-off-by: Johannes Schindelin <[email protected]>
@dfandrich

Copy link
Copy Markdown
Contributor

So, one needs an address that is guaranteed to go into the void everywhere...

RFC5737 reserves three address blocks that "SHOULD NOT appear on the public Internet", namely 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24

@bagder

bagder commented Sep 29, 2025

Copy link
Copy Markdown
Member

RFC5737 reserves three address blocks that "SHOULD NOT appear on the public Internet", namely 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24

They might still be used locally on networks where the curl test suite might run...

@yedayak

yedayak commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

It seems IPv6 has a discard prefix, 0100::/64. See rfc 6666

@icing

icing commented Sep 30, 2025 •

Copy link
Copy Markdown
Contributor Author

thanks for the tip, @dfandrich and @yedayak ! Worked that into a test case. Runs nicely on my macOS box, but of course in CI we get a "network unreachable"...well. well.

@icing
icing requested a review from bagder September 30, 2025 11:54
@bagder bagder closed this in b022389 Oct 1, 2025
vszakats added a commit that referenced this pull request Oct 2, 2025
- asyn-ares: fix compiler warning:
  ```
  lib/asyn-ares.c:751:17: error: code will never be executed [clang-diagnostic-unreachable-code,-warnings-as-errors]
    751 |     char *csv = ares_get_servers_csv(ares->channel);
        |                 ^~~~~~~~~~~~~~~~~~~~
  ```

- curl_trc: fix missing symbol:
  ```
  /usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_trc_timer'
  collect2: error: ld returned 1 exit status
  ```
  Ref: https://app.circleci.com/pipelines/github/curl/curl/15446/workflows/67afa113-9c49-4249-9180-f6f01fc7dfdd/jobs/149177
  Ref: https://github.com/curl/curl/actions/runs/18174250400/job/51736249444#step:33:623
  Follow-up to b022389 #18768

- multi: fix `-Wunreachable-code`:
  ```
  lib/multi.c:1107:28: error: code will never be executed [-Werror,-Wunreachable-code]
   1107 |     size_t timeout_count = Curl_llist_count(&data->state.timeoutlist);
        |                            ^~~~~~~~~~~~~~~~
  lib/multi.c:3054:35: error: code will never be executed [-Werror,-Wunreachable-code]
   3054 |       struct Curl_llist_node *e = Curl_llist_head(&data->state.timeoutlist);
        |                                   ^~~~~~~~~~~~~~~
  lib/multi.c:3380:7: error: code will never be executed [-Werror,-Wunreachable-code]
   3380 |       Curl_llist_head(&data->state.timeoutlist);
        |       ^~~~~~~~~~~~~~~
  ```

Cherry-picked from #18797
Closes #18799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants