Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4401 +/- ##
==========================================
- Coverage 96.74% 96.62% -0.12%
==========================================
Files 113 118 +5
Lines 43493 43918 +425
Branches 43493 43918 +425
==========================================
+ Hits 42076 42436 +360
- Misses 1405 1461 +56
- Partials 12 21 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
🟡 Changes recommended
Tests do not cover Retry and Version Negotiation with single_handshake_flight enabled, leaving valid-response PTO probing and rejected or ignored-response early-close behavior unverified.
2 open issues
What changed in this PR
Adds an opt-in single-handshake-flight mode to Neqo’s QUIC transport, supporting Firefox experiments that race HTTP/3 against TCP when QUIC support is unknown.
Changes:
- Closes unanswered client handshakes at the first probe timeout with
NoHandshakeResponse, without sending probes. - Preserves retransmission after a server response, including disabling the option after Version Negotiation.
- Adds tests for unanswered flights, Initial responses, and successful handshakes.
| File | Description |
|---|---|
neqo-transport/src/recovery/mod.rs |
Reports whether the probe timeout fired. |
neqo-transport/src/lib.rs |
Adds NoHandshakeResponse and tests its error-code mapping. |
neqo-transport/src/connection/tests/handshake.rs |
Tests early closure and normal handshake behavior. |
neqo-transport/src/connection/params.rs |
Adds and documents the default-disabled option. |
neqo-transport/src/connection/mod.rs |
Implements early closure and the Version Negotiation reset. |
Review effort: Balanced
| && self.conn_params.single_handshake_flight_enabled() | ||
| && self.role == Role::Client | ||
| && self.state == State::WaitInitial | ||
| && !matches!(self.address_validation, AddressValidationInfo::Retry { .. }) |
| .versions(version, self.conn_params.get_versions().all().to_vec()); | ||
| .versions(version, self.conn_params.get_versions().all().to_vec()) | ||
| // The server responded, so it speaks QUIC: no reason to give up early. | ||
| .single_handshake_flight(false); |
Client/server transfer resultsPerformance differences relative to 662ec9f. Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Table above only shows statistically significant changes. See all results below. All resultsTransfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.
Download data for |
Benchmark resultsNo significant performance differences relative to 662ec9f. All resultstransfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 time: [61.089 ms 61.124 ms 61.162 ms]
thrpt: [1.5967 GiB/s 1.5977 GiB/s 1.5986 GiB/s]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severetransfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 time: [60.573 ms 60.621 ms 60.668 ms]
thrpt: [1.6097 GiB/s 1.6109 GiB/s 1.6122 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mildtransfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 time: [3.8177 ms 3.8188 ms 3.8199 ms]
thrpt: [261.79 B/s 261.86 B/s 261.94 B/s]
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low mild
2 (2.00%) high mildtransfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 time: [88.011 ms 88.158 ms 88.303 ms]
thrpt: [113.25 Kelem/s 113.43 Kelem/s 113.62 Kelem/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mildstreams-flow-controlled/walltime/1-streams/each-4194304-bytes time: [12.894 ms 12.901 ms 12.908 ms]
thrpt: [309.88 MiB/s 310.06 MiB/s 310.23 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mildstreams-flow-controlled/walltime/10-streams/each-1048576-bytes time: [35.600 ms 35.615 ms 35.630 ms]
thrpt: [280.66 MiB/s 280.78 MiB/s 280.90 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mildstreams/walltime/1-streams/each-1000-bytes time: [160.19 µs 160.88 µs 161.74 µs]
thrpt: [5.8963 MiB/s 5.9280 MiB/s 5.9532 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mildstreams/walltime/1000-streams/each-1-bytes time: [4.7246 ms 4.7276 ms 4.7308 ms]
thrpt: [206.43 KiB/s 206.57 KiB/s 206.70 KiB/s]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low mild
5 (5.00%) high mild
1 (1.00%) high severestreams/walltime/1000-streams/each-1000-bytes time: [15.068 ms 15.078 ms 15.089 ms]
thrpt: [63.203 MiB/s 63.249 MiB/s 63.293 MiB/s]transfer/walltime/pacing-false/same-seed time: [3.4410 ms 3.4422 ms 3.4437 ms]
thrpt: [1.1343 GiB/s 1.1348 GiB/s 1.1352 GiB/s]transfer/walltime/pacing-false/varying-seeds time: [3.4429 ms 3.4440 ms 3.4455 ms]
thrpt: [1.1337 GiB/s 1.1342 GiB/s 1.1346 GiB/s]transfer/walltime/pacing-true/same-seed time: [3.9766 ms 3.9847 ms 3.9914 ms]
thrpt: [1002.1 MiB/s 1003.8 MiB/s 1005.9 MiB/s]transfer/walltime/pacing-true/varying-seeds time: [4.0188 ms 4.0213 ms 4.0244 ms]
thrpt: [993.94 MiB/s 994.71 MiB/s 995.32 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mildInstructions per cycleCriterion reported no significant timing changes. All benchmarks
Profiles for profiler.firefox.com (64)
Download data for |
Merging this PR will regress 2 benchmarks1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
da79bdc to
a47528d
Compare
Add `NetworkConfig::optimistic_quic`. When enabled and nothing signals that the origin supports HTTP/3 (no alt-svc entries, and no HTTPS service information has arrived), make one HTTP/3 attempt to the first origin address of the preferred family. A pending HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The attempt starts right before the first regular attempt and does not delay the regular attempts, so it races alongside TCP without slowing it down. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When enabled and nothing signals that the origin supports HTTP/3 (no alt-svc entries, and no HTTPS service information has arrived), make one HTTP/3 attempt to the first origin address of the preferred family. A pending HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The attempt starts right before the first regular attempt and does not delay the regular attempts, so it races alongside TCP without slowing it down. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When enabled and nothing signals that the origin supports HTTP/3 (no alt-svc entries, and no HTTPS service information has arrived), make one HTTP/3 attempt to the first origin address of the preferred family. A pending HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The attempt starts right before the first regular attempt and does not delay the regular attempts, so it races alongside TCP without slowing it down. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When enabled and nothing signals that the origin supports HTTP/3 (no alt-svc entries, and no HTTPS record advertising h3), make one HTTP/3 attempt to the first origin address of the preferred family. An HTTPS record with only other protocols, e.g. alpn=h2, or a pending HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. An HTTPS record with an ECH config does, as the attempt does not use ECH and would expose the server name. The attempt starts right before the first regular attempt and does not delay the regular attempts, so it races alongside TCP without slowing it down. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. With it, HTTP/3 is always tried. An alt-svc entry or HTTPS record that advertises HTTP/3 leads to regular HTTP/3 attempts as before. Without such a signal, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. An alt-svc entry or HTTPS record with only other protocols, e.g. h2, or a pending HTTPS query, e.g. a slow or timed out one, is no signal. The optimistic attempt uses the ECH config of an HTTPS record for the origin. When only HTTPS records for other targets carry an ECH config, there is no optimistic attempt, as it would have to go without ECH and expose the server name. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. With it, HTTP/3 is always tried. An alt-svc entry or HTTPS record that advertises HTTP/3 leads to regular HTTP/3 attempts as before. Without such a signal, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. An alt-svc entry or HTTPS record with only other protocols, e.g. h2, or a pending HTTPS query, e.g. a slow or timed out one, is no signal. The optimistic attempt uses the ECH config of an HTTPS record for the origin. When only HTTPS records for other targets carry an ECH config, there is no optimistic attempt, as it would have to go without ECH and expose the server name. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. With it, HTTP/3 is always tried. An alt-svc entry or HTTPS record that advertises HTTP/3 leads to regular HTTP/3 attempts as before. Without such a signal, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. An alt-svc entry or HTTPS record with only other protocols, e.g. h2, or a pending HTTPS query, e.g. a slow or timed out one, is no signal. The optimistic attempt uses the ECH config of an HTTPS record for the origin. When only HTTPS records for other targets carry an ECH config, there is no optimistic attempt, as it would have to go without ECH and expose the server name. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address waits, with or without ECH, so there is no second QUIC connection to that address. If the optimistic attempt fails, that endpoint is attempted normally. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. The optimistic attempt does not count as an attempt of its endpoint. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address is attempted normally, in parallel. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `NetworkConfig::optimistic_quic`. When nothing is known about the protocols the origin supports, i.e. there is no alt-svc entry and no positive HTTPS record, make one optimistic HTTP/3 attempt to the first origin address of the preferred family, running in parallel with the regular attempts. A pending or failed HTTPS query, e.g. a slow or timed out one, does not prevent the attempt. The new `optimistic` field on `Output::AttemptConnection` (and `ConnectionAttempt`) marks the attempt. The caller should send only a single QUIC handshake flight for it, e.g. with neqo's `ConnectionParameters::single_handshake_flight`, see mozilla/neqo#4401. The optimistic attempt does not count as an attempt of its endpoint. If an HTTPS record with h3 arrives while the optimistic attempt is in progress, its HTTP/3 endpoint to the same address is attempted normally, in parallel. This allows to experiment with optimistic QUIC in Firefox. Adding the field is a breaking API change.
Add `ConnectionParameters::single_handshake_flight`. When enabled, a client that gets no response at all (no Initial, Retry or Version Negotiation) to its first handshake flight closes the connection at the first PTO with `Error::NoHandshakeResponse`, instead of sending probes. This allows to experiment with optimistic QUIC in Firefox: attempting HTTP/3 against a server that is not known to support it (no Alt-Svc, no HTTPS DNS record), racing it alongside TCP at the cost of a single flight. A missing response most likely means no QUIC support, so retransmitting only wastes resources. A Version Negotiation response disables the option for the restarted connection, since the server evidently speaks QUIC.
a47528d to
d5ec080
Compare
Behind network.http.http3.optimistic_quic (default true), Happy Eyeballs races a single HTTP/3 attempt alongside TCP when neither Alt-Svc nor an HTTPS DNS record signals HTTP/3 support. The optimistic attempt is carried to Http3Session via the new NS_HTTP_OPTIMISTIC_HTTP3 caps bit and configures neqo to send a single handshake flight only, giving up at the first PTO if the server does not respond. A failed optimistic attempt does not exclude HTTP/3 for the origin. Adds the happy_eyeballs_h3_attempt_outcome labeled counter, recording whether each HTTP/3 attempt succeeded, failed or was cancelled, and which signal it had: none (optimistic), alt_svc, https_rr or both. Adds an "optimistic" field to the Happy Eyeballs connection profiler marker and an "optimistic_quic" field to its lifetime marker, and logs optimistic attempts in HappyEyeballsConnectionAttempt and Http3Session. Vendors neqo from mxinden-bot/neqo f654e68, i.e. v0.35.0 plus ConnectionParameters::single_handshake_flight from mozilla/neqo#4401, and happy-eyeballs from mozilla/happy-eyeballs#167 (d54b14d). mtu is unchanged from v0.35.0; its audit is extended to the new rev.
Behind network.http.http3.optimistic_quic (default true), Happy Eyeballs races a single HTTP/3 attempt alongside TCP when neither Alt-Svc nor an HTTPS DNS record signals HTTP/3 support. The optimistic attempt is carried to Http3Session via the new NS_HTTP_OPTIMISTIC_HTTP3 caps bit and configures neqo to send a single handshake flight only, giving up at the first PTO if the server does not respond. A failed optimistic attempt does not exclude HTTP/3 for the origin. Optimistic HTTP/3 applies only to direct connections to https origins, not via a proxy, as HTTP/3 needs TLS (RFC 9114, Section 3.1.2). Adds the happy_eyeballs_h3_attempt_outcome labeled counter, recording whether each HTTP/3 attempt succeeded, failed or was cancelled, and which signal it had: optimistic (none), alt_svc, https_rr or both. It also records optimistic_opted_out when a site's Alt-Svc or HTTPS record without HTTP/3 prevented the optimistic attempt. Adds an "optimistic" field to the Happy Eyeballs connection profiler marker and an "optimistic_quic" field to its lifetime marker, and logs optimistic attempts in HappyEyeballsConnectionAttempt and Http3Session. Vendors neqo from mxinden-bot/neqo f654e68, i.e. v0.35.0 plus ConnectionParameters::single_handshake_flight from mozilla/neqo#4401, and happy-eyeballs from mozilla/happy-eyeballs#167 (d54b14d). mtu is unchanged from v0.35.0; its audit is extended to the new rev.
Behind network.http.http3.optimistic_quic (default true), Happy Eyeballs races a single HTTP/3 attempt alongside TCP when neither Alt-Svc nor an HTTPS DNS record signals HTTP/3 support. The optimistic attempt is carried to Http3Session via the new NS_HTTP_OPTIMISTIC_HTTP3 caps bit and configures neqo to send a single handshake flight only, giving up at the first PTO if the server does not respond. A failed optimistic attempt does not exclude HTTP/3 for the origin. Optimistic HTTP/3 applies only to direct connections to https origins, not via a proxy, as HTTP/3 needs TLS (RFC 9114, Section 3.1.2). Adds the happy_eyeballs_h3_attempt_outcome labeled counter, recording whether each HTTP/3 attempt succeeded, failed or was cancelled, and which signal it had: optimistic (none), alt_svc, https_rr or both. It also records optimistic_opted_out when a site's Alt-Svc or HTTPS record without HTTP/3 prevented the optimistic attempt. Adds an "optimistic" field to the Happy Eyeballs connection profiler marker and an "optimistic_quic" field to its lifetime marker, and logs optimistic attempts in HappyEyeballsConnectionAttempt and Http3Session. Vendors neqo from mxinden-bot/neqo f654e68, i.e. v0.35.0 plus ConnectionParameters::single_handshake_flight from mozilla/neqo#4401, and happy-eyeballs from mozilla/happy-eyeballs#167 (d54b14d). mtu is unchanged from v0.35.0; its audit is extended to the new rev.
Behind network.http.http3.optimistic_quic (default true), Happy Eyeballs races a single HTTP/3 attempt alongside TCP when neither Alt-Svc nor an HTTPS DNS record signals HTTP/3 support. The optimistic attempt is carried to Http3Session via the new NS_HTTP_OPTIMISTIC_HTTP3 caps bit and configures neqo to send a single handshake flight only, giving up at the first PTO if the server does not respond. A failed optimistic attempt does not exclude HTTP/3 for the origin. Optimistic HTTP/3 applies only to direct connections to https origins, not via a proxy, as HTTP/3 needs TLS (RFC 9114, Section 3.1.2). Adds the happy_eyeballs_h3_attempt_outcome labeled counter, recording whether each HTTP/3 attempt succeeded, failed or was cancelled, and which signal it had: optimistic (none), alt_svc, https_rr or both. It also records optimistic_opted_out when a site's Alt-Svc or HTTPS record without HTTP/3 prevented the optimistic attempt. Adds an "optimistic" field to the Happy Eyeballs connection profiler marker and an "optimistic_quic" field to its lifetime marker, and logs optimistic attempts in HappyEyeballsConnectionAttempt and Http3Session. Vendors neqo from mxinden-bot/neqo f654e68, i.e. v0.35.0 plus ConnectionParameters::single_handshake_flight from mozilla/neqo#4401, and happy-eyeballs from mozilla/happy-eyeballs#167 (d54b14d). mtu is unchanged from v0.35.0; its audit is extended to the new rev.
| assert!(client.process_output(now).dgram().is_some()); | ||
| assert!(client.process_output(now).dgram().is_some()); | ||
|
|
||
| // The pacing timer, then the PTO. |
There was a problem hiding this comment.
Why are you expecting pacing, when nothing follows that?
martinthomson
left a comment
There was a problem hiding this comment.
The feature seems reasonable (we're going to miss some opportunities with packet loss, but whatever...) Some suggestions though.
| && self.role == Role::Client | ||
| && self.state == State::WaitInitial | ||
| && !matches!(self.address_validation, AddressValidationInfo::Retry { .. }) | ||
| && !self.server_packet_before_initial |
There was a problem hiding this comment.
I don't like the length of this check. I'd recommend a new state for this: SingleFlightSent, which would encapsulate a lot of these checks. There is no case I'm aware of where the server gets to interrupt that flight with something that would disable the feature, so this is safe.
Then, receipt of any(*) packet from the server would flip the client into a new state and you wouldn't need to check so many things here.
| && self.cid_manager.is_valid(packet.dcid()) | ||
| && !self.saved_datagrams.is_either_full() | ||
| => { | ||
| self.server_packet_before_initial = true; |
There was a problem hiding this comment.
This is where I think a new state saves you. Receiving a packet in that state (even an unvalidated one) flips the state back to the normal path.

Add
ConnectionParameters::single_handshake_flight. When enabled, a client that gets no response at all (no Initial, Retry or Version Negotiation) to its first handshake flight closes the connection at the first PTO withError::NoHandshakeResponse, instead of sending probes.This allows to experiment with optimistic QUIC in Firefox: attempting HTTP/3 against a server that is not known to support it (no Alt-Svc, no HTTPS DNS record), racing it alongside TCP at the cost of a single flight. A missing response most likely means no QUIC support, so retransmitting only wastes resources.
A Version Negotiation response disables the option for the restarted connection, since the server evidently speaks QUIC.