Skip to content

fix(transport/server): remove saved_datagrams.is_empty assert - #2887

Merged
mxinden merged 4 commits into
mozilla:mainfrom
mxinden:server-saved
Aug 22, 2025
Merged

mxinden merged 4 commits into
mozilla:mainfrom
mxinden:server-saved

Conversation

@mxinden

@mxinden mxinden commented Aug 21, 2025 •

Copy link
Copy Markdown
Member

Given a server with two saved datagrams, where the first does not trigger an immediate response, the server would execute multiple process_input calls, one per datagram, and thus run into the following assert:

assert!(
self.saved_datagrams.is_empty(),
"Otherwise, there would be more work to do."
);

This commit removes the assert. Correctness is still upheld without it.

Bug introduced in #2734.

Caught in https://treeherder.mozilla.org/jobs?repo=try&revision=05ccc36f73b45f2cff11b3f2c21044af706b779c&selectedTaskRun=NBGOUuvrRUiejEbiJFK4EA.0

@codecov

codecov Bot commented Aug 21, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.48%. Comparing base (c535de9) to head (43f653b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2887      +/-   ##
==========================================
- Coverage   95.49%   95.48%   -0.02%     
==========================================
  Files         115      115              
  Lines       34439    34439              
  Branches    34439    34439              
==========================================
- Hits        32889    32885       -4     
- Misses       1543     1545       +2     
- Partials        7        9       +2     
Components Coverage Δ
neqo-common 97.84% <ø> (ø)
neqo-crypto 89.77% <ø> (ø)
neqo-http3 94.42% <ø> (-0.03%) ⬇️
neqo-qpack 95.90% <ø> (ø)
neqo-transport 96.54% <ø> (-0.01%) ⬇️
neqo-udp 91.17% <ø> (ø)

Comment thread neqo-transport/src/server.rs Resolved
Comment thread neqo-transport/src/server.rs Resolved
Comment thread neqo-transport/src/server.rs Resolved
@github-actions

github-actions Bot commented Aug 21, 2025 •

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to c535de9.

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

@github-actions

github-actions Bot commented Aug 21, 2025 •

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to b1c4293.

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server (params) Mean ± σ Min Max MiB/s ± σ Δ main Δ main
google vs. google 456.5 ± 4.3 447.7 464.6 70.1 ± 7.4
google vs. neqo (cubic, paced) 273.0 ± 4.5 264.3 279.9 117.2 ± 7.1 💔 1.2 0.5%
msquic vs. msquic 131.6 ± 37.0 110.5 384.2 243.2 ± 0.9
msquic vs. neqo (cubic, paced) 151.9 ± 41.8 122.3 349.7 210.6 ± 0.8 0.2 0.1%
neqo vs. google (cubic, paced) 757.1 ± 4.5 750.1 769.0 42.3 ± 7.1 -0.7 -0.1%
neqo vs. msquic (cubic, paced) 155.3 ± 4.4 148.8 164.1 206.0 ± 7.3 -0.0 -0.0%
neqo vs. neqo (cubic) 92.1 ± 4.3 84.7 101.3 347.4 ± 7.4 0.1 0.1%
neqo vs. neqo (cubic, paced) 92.6 ± 5.3 84.5 111.6 345.5 ± 6.0 -0.3 -0.3%
neqo vs. neqo (reno) 91.8 ± 4.6 84.0 105.2 348.6 ± 7.0 -0.1 -0.1%
neqo vs. neqo (reno, paced) 93.5 ± 4.9 84.5 110.9 342.4 ± 6.5 0.2 0.2%
neqo vs. quiche (cubic, paced) 193.6 ± 4.5 187.9 203.5 165.3 ± 7.1 -0.6 -0.3%
neqo vs. s2n (cubic, paced) 220.6 ± 4.9 212.8 230.7 145.1 ± 6.5 -0.0 -0.0%
quiche vs. neqo (cubic, paced) 148.1 ± 5.6 135.5 159.1 216.1 ± 5.7 -0.9 -0.6%
quiche vs. quiche 146.2 ± 4.8 136.3 158.9 218.9 ± 6.7
s2n vs. neqo (cubic, paced) 170.9 ± 5.0 161.9 182.1 187.2 ± 6.4 0.4 0.2%
s2n vs. s2n 248.0 ± 26.3 232.0 349.6 129.0 ± 1.2

Download data for profiler.firefox.com or download performance comparison data.

@github-actions

github-actions Bot commented Aug 21, 2025 •

Copy link
Copy Markdown
Contributor

Benchmark results

Performance differences relative to b1c4293.

1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: Change within noise threshold.
       time:   [200.79 ms 201.22 ms 201.72 ms]
       thrpt:  [495.74 MiB/s 496.97 MiB/s 498.03 MiB/s]
change:
       time:   [−1.5235% −1.2341% −0.9313%] (p = 0.00 < 0.05)
       thrpt:  [+0.9401% +1.2496% +1.5471%]

Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high severe

1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.
       time:   [307.04 ms 308.54 ms 310.05 ms]
       thrpt:  [32.253 Kelem/s 32.410 Kelem/s 32.569 Kelem/s]
change:
       time:   [−0.8456% −0.2237% +0.4349%] (p = 0.49 > 0.05)
       thrpt:  [−0.4330% +0.2242% +0.8528%]

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild

1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [27.978 ms 28.107 ms 28.252 ms]
       thrpt:  [35.396   B/s 35.579   B/s 35.743   B/s]
change:
       time:   [−0.7645% −0.0701% +0.6163%] (p = 0.85 > 0.05)
       thrpt:  [−0.6125% +0.0701% +0.7704%]

Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high severe

1-conn/1-100mb-req/mtu-1504 (aka. Upload)/client: 💚 Performance has improved.
       time:   [202.24 ms 202.64 ms 203.12 ms]
       thrpt:  [492.31 MiB/s 493.48 MiB/s 494.47 MiB/s]
change:
       time:   [−4.3130% −4.0314% −3.7335%] (p = 0.00 < 0.05)
       thrpt:  [+3.8783% +4.2007% +4.5074%]

Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high severe

decode 4096 bytes, mask ff: No change in performance detected.
       time:   [11.580 µs 11.596 µs 11.620 µs]
       change: [−1.0387% −0.4674% +0.0095%] (p = 0.08 > 0.05)

Found 12 outliers among 100 measurements (12.00%)
1 (1.00%) low severe
4 (4.00%) low mild
3 (3.00%) high mild
4 (4.00%) high severe

decode 1048576 bytes, mask ff: No change in performance detected.
       time:   [3.0619 ms 3.0749 ms 3.0914 ms]
       change: [−0.3586% +0.1937% +0.8095%] (p = 0.53 > 0.05)

Found 9 outliers among 100 measurements (9.00%)
1 (1.00%) high mild
8 (8.00%) high severe

decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [19.378 µs 19.425 µs 19.478 µs]
       change: [−0.7946% −0.1891% +0.3194%] (p = 0.55 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) high mild
13 (13.00%) high severe

decode 1048576 bytes, mask 7f: No change in performance detected.
       time:   [5.0804 ms 5.0916 ms 5.1045 ms]
       change: [−0.4304% −0.0713% +0.2657%] (p = 0.69 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
2 (2.00%) low mild
12 (12.00%) high severe

decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [5.5228 µs 5.5397 µs 5.5642 µs]
       change: [−0.5009% +0.2468% +0.9914%] (p = 0.56 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
2 (2.00%) low mild
3 (3.00%) high mild
6 (6.00%) high severe

decode 1048576 bytes, mask 3f: Change within noise threshold.
       time:   [1.7578 ms 1.7581 ms 1.7587 ms]
       change: [−0.8547% −0.4572% −0.1305%] (p = 0.01 < 0.05)

Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe

coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [88.295 ns 88.635 ns 88.977 ns]
       change: [−0.1233% +0.3051% +0.7951%] (p = 0.21 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
12 (12.00%) high mild
2 (2.00%) high severe

coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [106.11 ns 106.44 ns 106.79 ns]
       change: [−2.2316% −0.8079% +0.1883%] (p = 0.23 > 0.05)

Found 10 outliers among 100 measurements (10.00%)
10 (10.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [105.41 ns 105.71 ns 106.11 ns]
       change: [−0.3367% +0.2159% +1.0246%] (p = 0.56 > 0.05)

Found 15 outliers among 100 measurements (15.00%)
5 (5.00%) low severe
3 (3.00%) low mild
2 (2.00%) high mild
5 (5.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [88.724 ns 88.845 ns 88.993 ns]
       change: [−1.0640% −0.1365% +0.7986%] (p = 0.79 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe

RxStreamOrderer::inbound_frame(): No change in performance detected.
       time:   [107.97 ms 108.05 ms 108.13 ms]
       change: [−0.2236% +0.0248% +0.2017%] (p = 0.85 > 0.05)

Found 35 outliers among 100 measurements (35.00%)
11 (11.00%) low severe
3 (3.00%) low mild
8 (8.00%) high mild
13 (13.00%) high severe

sent::Packets::take_ranges: :green_heart: Performance has improved.
       time:   [5.1030 µs 5.1804 µs 5.2533 µs]
       change: [−41.991% −36.043% −25.428%] (p = 0.00 < 0.05)

Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe

transfer/pacing-false/varying-seeds: Change within noise threshold.
       time:   [36.407 ms 36.472 ms 36.536 ms]
       change: [−0.7898% −0.5268% −0.2533%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild

transfer/pacing-true/varying-seeds: No change in performance detected.
       time:   [37.565 ms 37.685 ms 37.809 ms]
       change: [−0.7608% −0.3417% +0.1029%] (p = 0.13 > 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

transfer/pacing-false/same-seed: Change within noise threshold.
       time:   [36.379 ms 36.466 ms 36.566 ms]
       change: [+0.1919% +0.5221% +0.8550%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

transfer/pacing-true/same-seed: No change in performance detected.
       time:   [37.974 ms 38.066 ms 38.160 ms]
       change: [−0.4916% −0.1384% +0.1909%] (p = 0.42 > 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

Download data for profiler.firefox.com or download performance comparison data.

Given a server with two saved datagrams, where the first does not
trigger an immediate response, the server would execute multiple
`process_input` calls, one per datagram and thus run into the following
`assert`:

https://github.com/mozilla/neqo/blob/4d17dea10f163189022ec1c11e82602da6a7e198/neqo-transport/src/server.rs#L476-L479

With this commit, all saved datagrams are passed to `process_input` at
once, processing it through the functions `while` loop.

As a side effect, replaces `VecDeque` with `Vec` as suggested by Martin
in mozilla#2734 (comment).

Bug introduced in mozilla#2734.
@mxinden mxinden changed the title fix(transport/server): call process_input with all saved_datagrams fix(transport/server): remove saved_datagrams.is_empty assert Aug 21, 2025
@mxinden
mxinden marked this pull request as ready for review August 21, 2025 12:50

@martinthomson martinthomson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a suggestion for the test. And, yes, we don't have to be super-performant when it comes to saved datagrams. The extra complexity of batching is probably not worth it.

Comment thread neqo-transport/tests/server.rs Resolved
@mxinden
mxinden requested a review from martinthomson August 22, 2025 11:00
@mxinden
mxinden added this pull request to the merge queue Aug 22, 2025
Merged via the queue into mozilla:main with commit 02b78b8 Aug 22, 2025
@mxinden
mxinden deleted the server-saved branch August 22, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants