Skip to content

chore: sync with quinn@main#606

Merged
dignifiedquire merged 24 commits intomainfrom
sync-quinn-2026-04
Apr 22, 2026
Merged

chore: sync with quinn@main#606
dignifiedquire merged 24 commits intomainfrom
sync-quinn-2026-04

Conversation

@dignifiedquire
Copy link
Copy Markdown
Contributor

Synced up to quinn-rs/quinn@07ce61c

Closes #602

Commits applied in this PR

upstream SHA PR subject noq commit
06f7f7df1 #2611 Take boxed connection ID generator factories 167c709c7
404db1bc9 #2495 Move the ref counts out e6772ea9f (bundled)
4b7a03949 #2495 Fix the (pre-existing) rightward drift by inverting conditions e6772ea9f (bundled)
475b55bad #2495 Early return in RecvStream::drop() e6772ea9f (bundled)
803c81479 #2541 Remove RecvStreams from blocked_readers on stop e6772ea9f (bundled)
37625fe2d #2609 quinn: fix ref count logic for ConnectionRef and EndpointRef e6772ea9f (bundled)
07ce61cc2 #2612 Test cleanup of connections/endpoints when all references are dropped e6772ea9f (bundled)
42de9dd2b #2469 refactor(quinn-udp): extract decode_socket_addr helper 2e4effbe4
4742a70e3 #2469 refactor(quinn-udp): extract ControlMetadata helper 6f5904350
2964782b4 #2472 refactor(quinn-udp): split fast&slow send/recv paths a17058e80
459c34714 #2549 add metric for spurious congestion events 0c78d6435
f853e5e08 #2550 fix(perf): suppress table output in JSON mode 0155ee3f6
a0ec97a50 #2463 feat(quinn-udp): make Apple fast datapath opt-in 412dc6684
bb005309e #2560 docs: fix book build with mdbook 0.5.2 98cb0ad67
ee8f9469b #2565 fix: reuse existing socket for probing GRO/GSO support 012530527
56bba7c0f #2565 refactor: remove gro module 1174207fa
04ba57c64 #2565 fix: remove opportunistic GRO syscall 35400c04e
f0905db64 #2570 docs(quinn): improve Connection::close_reason() documentation 287fd2b63
0adcd2053 #2573 docs: clarify that Event::ConnectionLost is not emitted on local close 7f34b4517
b8e4d3b9a #2572 quinn: Make Endpoint::server dual-stack V6 by default 461fe7f28
52c7ad189 #2583 refactor(quinn-udp): add retry_if_interrupted helper 348b91383
8acb578f1 #2584 fix(unix): disable GSO after probing 85c022d75
e01f99e26 #2571 fix: Resolve sendmsg_x/recvmsg_x via dlsym 881d6f151
eff557289 #2579 proto: send STREAMS_BLOCKED when stream limit is hit e64abef10
dc8640052 #2556 Introduce max_outgoing_bytes_per_second option ffe5a5474
bda24fdae #2602 Upgrade rustls-platform-verifier to 0.7 e4570ea71

Already present in noq

upstream SHA PR subject
16e1aaad5 #2511 Fix unused_mut warning from Rust 1.93
e96c27943 #2533 quinn-proto: make cids_exhausted overflow-safe on 32-bit
5db36fe4e #2534 docs: fix typo in EndpointStats
d305440ef #2540 Upgrade fastbloom to 0.17
57b9d0abf #2558 fuzz: add fuzzing target for parsing transport parameters
655a8ad09 #2558 proto: avoid unwrapping varint decoding during parameters parsing
7f7d9ea90 #2610 Fix clippy warnings from 1.95

Skipped

upstream SHA PR subject reason
e5b30f513 #2532 quinn-udp: make ECN best-effort on Windows (Wine/Proton) noq already has its own Wine/Proton ECN handling using AtomicBool runtime-detection (noq PR #414); upstream's static-bool approach would be redundant.
70d083be9 #2540 Upgrade to qlog 0.16 noq uses its own n0-qlog fork with a different API.
d8db7a047 #2599 Upgrade to qlog 0.17 Same reason as above.
41bf1db60 #2564 fix: evaluate max_gso_segments for every socket on Windows noq already tracks max_gso_segments per-socket on an AtomicUsize.
905e1090f #2599 Bump MSRV to 1.82 (for qlog -> serde_with) noq is already at MSRV 1.88.
95863afb5 #2602 Bump MSRV to 1.85 (for rustls-platform-verifier) Same reason as above.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/606/docs/noq/

Last updated: 2026-04-22T13:19:16Z

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Performance Comparison Report

e4570ea71f8bee53cdb836a4f653492537e7406e - artifacts

No results available

---
a51e91192345b90a2a5df2a49f92409ca87363c3 - artifacts

No results available

---
69bb2026282a946655a9ef7a4e1e3e5110cdf7e7 - artifacts

No results available

---
513603369ef447508beabec486657c49885e11c1 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5400.1 Mbps 7843.8 Mbps -31.2% 94.4% / 99.5%
medium-concurrent 5517.5 Mbps 7831.8 Mbps -29.5% 94.7% / 99.7%
medium-single 4037.1 Mbps 4748.6 Mbps -15.0% 93.9% / 100.0%
small-concurrent 3830.5 Mbps 5203.3 Mbps -26.4% 99.0% / 152.0%
small-single 3486.3 Mbps 4870.1 Mbps -28.4% 90.9% / 101.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3114.6 Mbps 4079.0 Mbps -23.6%
lan 782.4 Mbps 796.4 Mbps -1.8%
lossy 69.8 Mbps 65.5 Mbps +6.7%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

noq is 25.9% slower on average

---
79b20f445379515ff085bc8dc940a7118cd1e331 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5380.6 Mbps 7984.8 Mbps -32.6% 97.7% / 149.0%
medium-concurrent 5492.3 Mbps 7691.6 Mbps -28.6% 98.0% / 149.0%
medium-single 4026.5 Mbps 4749.0 Mbps -15.2% 91.9% / 101.0%
small-concurrent 3795.2 Mbps 5346.2 Mbps -29.0% 95.5% / 102.0%
small-single 3561.8 Mbps 4736.2 Mbps -24.8% 97.6% / 153.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal N/A 4121.0 Mbps N/A
lan N/A 810.3 Mbps N/A
lossy N/A 62.5 Mbps N/A
wan N/A 83.8 Mbps N/A

Summary

noq is 27.0% slower on average

@n0bot n0bot Bot added this to iroh Apr 22, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Apr 22, 2026
Ralith and others added 23 commits April 22, 2026 15:15
When we store a type-erased, boxed value internally, accepting that
value directly allows users to avoid double-boxing. Probably not hugely
important in this case, but we've been adopting this pattern everywhere
else and we should be consistent.

(cherry picked from commit 06f7f7df1be952c41c567ae708b86d127d344c63)
…cUsize

Avoids locking the State mutex on every Clone/Drop of a ConnectionRef
or EndpointRef: the count now lives on the lockless Shared struct as
an AtomicUsize bumped/decremented with Relaxed ordering.

Also folds in the two related upstream stream-cleanup changes and
ports all four regression tests so the port has coverage for the
drop/stop paths.

Ports (adapted to noq's double-Arc ConnectionRef and WeakConnectionHandle
machinery):
- quinn-rs/quinn#2495 @ 404db1bc9, 4b7a03949, 475b55bad
  (ref-count move; rightward-drift cleanup; RecvStream::drop early return
  + stream_drop_removes_blocked_reader test)
- quinn-rs/quinn#2609 @ 37625fe2d
  (fix: fetch_sub returns prior value, use >1 / ==1 semantics)
- quinn-rs/quinn#2541 @ 803c814
  (RecvStream::stop clears blocked_readers + recv_stream_cancel_stop_drop test)
- quinn-rs/quinn @ 07ce61cc2
  (dropped_endpoint_cleans_up / dropped_connection_cleans_up tests)
(cherry picked from commit 42de9dd2bec578bee21c9e0bf966dee01f8b229b)
(cherry picked from commit 4742a70e336e2d724b5900144d5fb164fbe31a18)
Separate the fast path (`msghdr_x`-based) and slow path (`msghdr`-based)
implementations to prepare for runtime dispatch between them.

Broken out of #2463 as suggested by @djc.

(cherry picked from commit 2964782b4fcc8157755ecf17e439b28f8d4e4fea)
(cherry picked from commit 459c347149e7b20d436aaf29fb5ac320e18e107c)
Suppress table output meant to provide human-friendly visualization
when using the `--json` CLI option and its argument is `-`, that is,
when the JSON output targets stdout.

Fixes #2544.

(cherry picked from commit f853e5e0826a00f4b80551986eba0ca251ae1b45)
Add runtime dispatch so callers explicitly opt in
to the `sendmsg_x`/`recvmsg_x` fast datapath
instead of using it unconditionally.

(cherry picked from commit a0ec97a50bdab237450dce97b69a63419ef0ef25)
(cherry picked from commit bb005309e60b1d056d004dca44dee838bcaa13b8)
Instead of creating two throw-away sockets for probing GRO & GSO,
use the existing socket that gets passed into `UdpSocketState::new`.

Related: #2564
(cherry picked from commit ee8f9469b8b13502cbad587940cf2c36a69bdeef)
(cherry picked from commit 56bba7c0fa393a7aed8b5f99989f02e69cee72a4)
(cherry picked from commit 04ba57c643a573b2cd9a9666a5e5cd92dad05504)
(cherry picked from commit f0905db64178771a62c433c8b0b0e095dfaa8f66)
Clarify in the documentation for `Event::ConnectionLost`, `is_closed()`,
and `is_handshaking()` that the `ConnectionLost` event is only emitted
when the connection is closed by the peer or due to an error/timeout.
When the local application calls `Connection::close()`, no
`ConnectionLost` event is emitted; instead, pending operations fail with
`ConnectionError::LocallyClosed`.

Fixes #1495

(cherry picked from commit 0adcd2053107e302347c4b9741159a7ff0b6c9bb)
(cherry picked from commit b8e4d3b9acf205c5c3304fe901ac40d80408e199)
Replaces the repeated EINTR-retry loop pattern in `send_single`,
`send_via_sendmsg_x`, `recv_via_recvmmsg`, and `recv_via_recvmsg_x`.

(cherry picked from commit 52c7ad18982e02fa112d6f401572213e08709df6)
After probing the given socket for GSO support, we need to disable this option
again to ensure we can selectively enable it via our cmsg codepaths.

(cherry picked from commit 8acb578f10b02986050bc600e629f56f40162266)
The fast-apple-datapath feature previously declared `sendmsg_x` and
`recvmsg_x` as hard extern "C" symbols. On Apple OS versions where these
private APIs don't exist, the dynamic linker would reject the binary at
load time.

Replace the `extern "C"` block with lazy `OnceLock`-based resolvers
using `dlsym`. Both functions now return `Option<Fn>`, and the call
sites in `send_via_sendmsg_x` and `recv_via_recvmsg_x` propagate an
`Unsupported` error if the symbol is absent. This allows callers to
probe availability at runtime before enabling the fast path.

(cherry picked from commit e01f99e2658b1d0d7f31930ee014701cb34bc2d0)
(cherry picked from commit eff55728936615479edeb32df3847372fab55c32)
(cherry picked from commit dc8640052a64eb05b463b490b0a0a0f4b0cef9a6)
(cherry picked from commit bda24fdae5a6fa9215ef045498f7946c93011fc9)
@dignifiedquire
Copy link
Copy Markdown
Contributor Author

proptest failure reproduces on main already, made a PR #609

@dignifiedquire dignifiedquire merged commit 877dcca into main Apr 22, 2026
33 of 37 checks passed
@dignifiedquire dignifiedquire deleted the sync-quinn-2026-04 branch April 22, 2026 14:06
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Merge Quinn main