Skip to content

WebTransport: drop a closed session's queued datagrams on teardown - #3992

Closed
jesup wants to merge 1 commit into
users/jesup/report_datagramsfrom
users/jesup/drop_datagrams_on_teardown
Closed

jesup wants to merge 1 commit into
users/jesup/report_datagramsfrom
users/jesup/drop_datagrams_on_teardown

Conversation

@jesup

@jesup jesup commented Sep 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@jesup

jesup commented Sep 14, 2026 •

Copy link
Copy Markdown
Member Author

Copilot AI 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.

🟡 Changes recommended

The implementation is sound, but its comments inaccurately claim transport never expires orphaned datagrams.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Drops and reports queued WebTransport datagrams when a session is removed.

Changes:

  • Exposes session queue cleanup internally.
  • Invokes cleanup during extended-CONNECT teardown.
  • Adds peer-reset regression coverage.
File summaries
File Description
connection.rs Cleans queued datagrams during teardown.
session.rs Exposes the cleanup method crate-wide.
datagrams.rs Tests cleanup after peer reset.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread neqo-http3/src/connection.rs Outdated
Comment thread neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.rs Outdated
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (dbd0f61) to head (dc976e1).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           users/jesup/report_datagrams    #3992      +/-   ##
================================================================
- Coverage                         96.95%   96.93%   -0.03%     
================================================================
  Files                               119      119              
  Lines                             41579    41579              
  Branches                          41579    41579              
================================================================
- Hits                              40312    40303       -9     
- Misses                             1241     1252      +11     
+ Partials                             26       24       -2     
Flag Coverage Δ
freebsd 94.46% <100.00%> (+<0.01%) ⬆️
linux 97.14% <100.00%> (+<0.01%) ⬆️
macos 95.29% <100.00%> (-0.03%) ⬇️
windows 95.39% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
neqo-common 99.31% <ø> (ø)
neqo-http3 95.40% <100.00%> (ø)
neqo-qpack 96.97% <ø> (ø)
neqo-transport 97.89% <ø> (-0.04%) ⬇️
neqo-udp 95.37% <ø> (ø)
mtu 89.13% <ø> (ø)

@codspeed

codspeed Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 4.49%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 11 regressed benchmarks
✅ 84 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation decode 1000 STREAM frames 179.6 µs 226.5 µs -20.68%
❌ Simulation decode 100 STREAM frames 19.3 µs 24 µs -19.9%
❌ Simulation decode 10 STREAM frames 3.4 µs 4 µs -14.57%
❌ Simulation coalesce_acked_from_zero 1 ranges 2.7 µs 2.8 µs -5.79%
❌ Simulation coalesce_acked_from_zero 3 ranges 3.6 µs 3.7 µs -4.6%
❌ Simulation Builder encode+encrypt ACK packet 21.9 µs 22.7 µs -3.26%
❌ Simulation Builder encode+encrypt STREAM packet 27.9 µs 28.7 µs -2.58%
❌ WallTime neqo-quiche 38.9 ms 39.8 ms -2.35%
❌ Simulation coalesce_acked_from_zero 10 ranges 9.7 µs 9.9 µs -2.35%
❌ WallTime walltime/pacing-false/same-seed 2 ms 2 ms -2.32%
❌ Simulation simulated/pacing-false/varying-seeds 72.7 ms 74.4 ms -2.23%
⚡ Simulation mark_sent sequential 234.1 µs 210.7 µs +11.14%
⚡ Simulation mark_sent retransmit 33.4 µs 32.3 µs +3.44%
⚡ WallTime neqo-s2n 50 ms 48.9 ms +2.13%
⚡ Simulation simulated/10-streams/each-1048576-bytes 516.5 ms 506.1 ms +2.06%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing users/jesup/drop_datagrams_on_teardown (dc976e1) with users/jesup/report_datagrams (266d6d3)1

Open in CodSpeed

Footnotes

  1. No successful run was found on users/jesup/report_datagrams (dbd0f61) during the generation of this report, so 6596d7b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@jesup
jesup force-pushed the users/jesup/report_datagrams branch from 51d14be to fe2247d Compare September 14, 2026 05:31
@jesup
jesup requested a review from omansfeld as a code owner September 14, 2026 05:31
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from 0436765 to 6d838db Compare September 14, 2026 05:31
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from fe2247d to c696957 Compare September 14, 2026 17:56
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from 6d838db to e919805 Compare September 14, 2026 17:56
Comment thread neqo-http3/src/connection.rs Outdated
Comment thread neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.rs Outdated
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from c696957 to d10a0cd Compare September 16, 2026 03:45
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from e919805 to 6c8995d Compare September 16, 2026 03:45
@github-actions

Copy link
Copy Markdown
Contributor

Performance profiles for profiler.firefox.com

Benchmarks (14)
  • neqo-bin-main: pr · base
  • neqo-common-decoder: pr · base
  • neqo-http3-streams_simulated: pr · base
  • neqo-http3-streams_walltime: pr · base
  • neqo-transport-frame_decode: pr · base
  • neqo-transport-min_bandwidth: pr · base
  • neqo-transport-pacer: pr · base
  • neqo-transport-packet_codec: pr · base
  • neqo-transport-range_tracker: pr · base
  • neqo-transport-rx_stream_orderer: pr · base
  • neqo-transport-send_streams: pr · base
  • neqo-transport-sent_packets: pr · base
  • neqo-transport-transfer_simulated: pr · base
  • neqo-transport-transfer_walltime: pr · base
Comparisons (5)

@jesup
jesup force-pushed the users/jesup/report_datagrams branch from 19fa640 to 924e577 Compare September 23, 2026 23:55
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from 609dbad to f3f6e7c Compare September 23, 2026 23:55
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from 924e577 to 4c03816 Compare September 25, 2026 10:28
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from f3f6e7c to b3f7e86 Compare September 25, 2026 10:28
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from 4c03816 to c49ebd3 Compare September 25, 2026 12:35
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from b3f7e86 to fad8dba Compare September 25, 2026 12:35
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from c49ebd3 to 540e2cf Compare September 25, 2026 15:05
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch 2 times, most recently from 37fdffd to 5f27707 Compare September 30, 2026 03:30
@jesup
jesup force-pushed the users/jesup/report_datagrams branch 2 times, most recently from 266d6d3 to df27015 Compare September 30, 2026 15:32
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from 5f27707 to 0415ed4 Compare September 30, 2026 15:32

@mxinden mxinden 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.

Pull request name needs updating. Queued datagrams have been dropped before. This pull request just updates stats and emits events through wt.borrow_mut().drop_queued_datagrams.

Comment on lines +303 to +311
fn next_dgram(server: &mut Http3Server, mut t: Instant) -> (Datagram, Instant) {
loop {
match server.process_output(t) {
Output::Datagram(d) => return (d, t),
Output::Callback(delay) => t += delay,
Output::None => panic!("the server had nothing to send"),
}
}
}

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.

Nit: Either don't take a mut t, or don't return an Instant. Preference for the former. Doing both makes the function signature unintuitive in my eyes.

A session reset by the peer leaves the stream maps via
remove_extended_connect, which is the only teardown path that has both the
session and the Connection the queue lives on.  Drop the queue there so
every path counts what was still queued as dropped and removes the
per-session entry, including one re-created by a max-buffered or max-age
change after the session had already closed.
@jesup
jesup force-pushed the users/jesup/report_datagrams branch from df27015 to dbd0f61 Compare October 2, 2026 21:48
@jesup
jesup force-pushed the users/jesup/drop_datagrams_on_teardown branch from 0415ed4 to dc976e1 Compare October 2, 2026 21:48
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to users/jesup/report_datagrams at dbd0f61.

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: ⚠️M BP BA
neqo-pr vs. kwik: ⚠️DC Z L1 C1 🚀C2 V2 BP
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: Z A L1 C1
neqo-pr vs. mvfst: A ⚠️BA
neqo-pr vs. neqo: Z A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z C1 CM
neqo-pr vs. picoquic: Z A ⚠️BA
neqo-pr vs. quic-go: A ⚠️C1
neqo-pr vs. quiche: BP BA
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: S R Z A L1 C1
aioquic vs. neqo-pr: ⚠️L1 CM
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
msquic vs. neqo-pr: CM
mvfst vs. neqo-pr: Z L1 C1 CM
neqo vs. neqo-pr: Z A
ngtcp2 vs. neqo-pr: ⚠️C1
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: CM
quic-zig vs. neqo-pr: CM
quiche vs. neqo-pr: 🚀C1 CM
quinn vs. neqo-pr: V2 CM
s2n-quic vs. neqo-pr: CM
tquic vs. neqo-pr: CM
xquic vs. neqo-pr: M CM
All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to dbd0f61.

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

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-neqo-cubic 70.8 ± 0.5 69.6 – 71.9 70.8 ± 0.5 452.2 ± 3.0 💔 +0.9 (+1.2%)
neqo-neqo-newreno 19.5 ± 0.1 19.1 – 19.8 19.5 ± 0.1 1644.7 ± 12.5 💚 -0.3 (-1.6%)

Table above only shows statistically significant changes. See all results below.

All results

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

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-google 134.2 ± 0.5 132.9 – 135.8 134.2 ± 0.5 238.4 ± 0.9
google-neqo-cubic 70.8 ± 0.5 69.6 – 71.9 70.8 ± 0.5 452.2 ± 3.0 💔 +0.9 (+1.2%)
neqo-google-cubic 226.8 ± 28.7 172.7 – 305.0 225.4 ± 32.4 141.1 ± 17.8 +1.9 (+0.9%)
neqo-neqo-cubic 19.3 ± 0.2 18.9 – 19.8 19.3 ± 0.2 1658.9 ± 15.1 -0.2 (-0.8%)
neqo-neqo-cubic-nopacing 19.3 ± 0.2 18.9 – 19.8 19.3 ± 0.1 1661.6 ± 14.0 -0.1 (-0.5%)
neqo-neqo-newreno 19.5 ± 0.1 19.1 – 19.8 19.5 ± 0.1 1644.7 ± 12.5 💚 -0.3 (-1.6%)
neqo-neqo-newreno-nopacing 19.0 ± 0.2 18.4 – 19.6 19.0 ± 0.2 1684.6 ± 19.3 -0.1 (-0.4%)
neqo-quiche-cubic 32.9 ± 0.3 32.3 – 33.4 32.8 ± 0.4 973.8 ± 9.0 +0.1 (+0.4%)
neqo-s2n-cubic 38.3 ± 0.2 37.8 – 39.3 38.3 ± 0.2 834.9 ± 5.3 +0.0 (+0.1%)
quiche-neqo-cubic ⚠️ 38.1 ± 2.8 36.9 – 64.9 37.7 ± 0.3 840.0 ± 60.7 +0.0 (+0.1%)
quiche-quiche 39.5 ± 0.2 39.2 – 40.1 39.5 ± 0.2 809.4 ± 3.7
s2n-neqo-cubic 111.7 ± 0.3 111.1 – 113.4 111.7 ± 0.2 286.5 ± 0.9 +0.1 (+0.1%)
s2n-s2n ⚠️ 169.4 ± 30.7 134.8 – 260.4 159.7 ± 0.6 188.9 ± 34.2

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to dbd0f61.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [50.107 ms 50.175 ms 50.285 ms]
       thrpt:  [1.9421 GiB/s 1.9463 GiB/s 1.9490 GiB/s]
Found 7 outliers among 100 measurements (7.00%)
6 (6.00%) high mild
1 (1.00%) high severe
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [49.533 ms 49.581 ms 49.629 ms]
       thrpt:  [1.9677 GiB/s 1.9696 GiB/s 1.9716 GiB/s]
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [3.0056 ms 3.0067 ms 3.0078 ms]
       thrpt:  [332.47   B/s 332.59   B/s 332.71   B/s]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [66.258 ms 66.520 ms 66.790 ms]
       thrpt:  [149.72 Kelem/s 150.33 Kelem/s 150.93 Kelem/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [10.638 ms 10.640 ms 10.643 ms]
       thrpt:  [375.85 MiB/s 375.92 MiB/s 376.00 MiB/s]
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [27.788 ms 27.799 ms 27.810 ms]
       thrpt:  [359.58 MiB/s 359.73 MiB/s 359.87 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1-streams/each-1000-bytes
       time:   [133.08 µs 133.63 µs 134.34 µs]
       thrpt:  [7.0988 MiB/s 7.1367 MiB/s 7.1664 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [3.7764 ms 3.7893 ms 3.8017 ms]
       thrpt:  [256.88 KiB/s 257.72 KiB/s 258.60 KiB/s]
streams/walltime/1000-streams/each-1000-bytes
       time:   [11.061 ms 11.064 ms 11.068 ms]
       thrpt:  [86.165 MiB/s 86.193 MiB/s 86.220 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
transfer/walltime/pacing-false/same-seed
       time:   [2.0704 ms 2.0713 ms 2.0724 ms]
       thrpt:  [1.8849 GiB/s 1.8859 GiB/s 1.8867 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [2.0070 ms 2.0079 ms 2.0091 ms]
       thrpt:  [1.9443 GiB/s 1.9454 GiB/s 1.9463 GiB/s]
transfer/walltime/pacing-true/same-seed
       time:   [2.0434 ms 2.0445 ms 2.0458 ms]
       thrpt:  [1.9094 GiB/s 1.9106 GiB/s 1.9116 GiB/s]
transfer/walltime/pacing-true/varying-seeds
       time:   [2.0817 ms 2.0828 ms 2.0842 ms]
       thrpt:  [1.8742 GiB/s 1.8755 GiB/s 1.8765 GiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.18 3.23 +1.5%
streams/walltime/1000-streams/each-1000-bytes 3.08 3.10 +0.6%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.19 3.17 -0.6%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.19 3.20 +0.4%
streams/walltime/1000-streams/each-1-bytes 3.27 3.28 +0.4%
transfer/walltime/pacing-false/same-seed 2.88 2.87 -0.3%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.24 3.23 -0.2%
transfer/walltime/pacing-false/varying-seeds 2.88 2.89 +0.2%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 3.05 3.05 +0.2%
transfer/walltime/pacing-true/varying-seeds 2.89 2.89 +0.1%
streams/walltime/1-streams/each-1000-bytes 2.49 2.49 +0.1%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.24 2.24 +0.1%
transfer/walltime/pacing-true/same-seed 2.88 2.88 +0.0%
Profiles for profiler.firefox.com (62)

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

@jesup jesup closed this Oct 3, 2026
@jesup
jesup deleted the users/jesup/drop_datagrams_on_teardown branch October 3, 2026 02:13
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.

4 participants