Repository navigation
cf-https-connect: fall back from HTTP/3 at the happy eyeballs timeouts - #23238
Closed
nicolas-grekas wants to merge 3 commits into
Closed
nicolas-grekas wants to merge 3 commits into
nicolas-grekas wants to merge 3 commits into
Conversation
When the first attempt has seen data at the soft timeout, nothing armed a timer for the hard timeout, so the second attempt started on the next unrelated wakeup only. With HTTP/3 to a host that answers on UDP but does not complete the handshake, that is the QUIC retransmission timer, about one second later, whatever the happy eyeballs timeout is. Follow-up to 567803d curl#21267
A receive call that ends in EAGAIN returns CURLE_OK, which marked the QUIC connection as having seen data on the first attempt to read. The soft happy eyeballs timeout then never started the fallback, so a host silently dropping UDP made HTTP/3 wait for the hard timeout instead. Follow-up to 5d044ad curl#12678
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The junk-packet test assumes ngtcp2 behavior but currently runs against incompatible HTTP/3 backends.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes HTTP/3-to-TCP fallback timing when UDP traffic is dropped or unproductive.
Changes:
- Rearms the hard ALPN fallback timer after the soft timeout.
- Marks QUIC replies only when bytes were received.
- Adds silent-UDP and junk-response regression tests.
| File | Description |
|---|---|
lib/cf-https-connect.c |
Rearms the hard fallback timer. |
lib/vquic/vquic.c |
Tracks actual received byte counts. |
tests/http/test_06_eyeballs.py |
Tests soft and hard HTTP/3 fallback timing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…agram timeout test to ngtcp2' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
Thanks! |
vszakats
reviewed
Oct 11, 2026
Comment on lines
+108
to
+112
| try: | ||
| _, addr = sock.recvfrom(65536) | ||
| sock.sendto(b'\0', addr) | ||
| except socket.timeout: | ||
| pass |
Member
There was a problem hiding this comment.
GitHub's Python checker flagged this as "Empty except".
Is there a way to rewrite that avoids it?
Contributor
|
GitHub's Python checker flagged this as "Empty except". Is there a way to rewrite that avoids it?
I would use `contextlib.suppress`.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Since 8.20.0, an HTTP/3 attempt to a host that silently drops UDP, as most firewalls do, falls back to TCP after about one second, whatever
--happy-eyeballs-timeout-mssays. 8.19.0 waits 200ms, the hard timeout.There are two causes, one commit each:
With ngtcp2, against a local port that swallows UDP,
curl --http3now falls back after 100ms instead of 990ms. Against a port that answers with junk, it falls back after 200ms instead of 980ms. Each new test_06 case fails without the commit it comes with, and the rest of the pytest suite gives the same results as master here.