Repository navigation
refactor(quic)!: one Limits type for both QUIC runtimes - #5871
Conversation
moq-quic owns `Limits` (validated, `#[non_exhaustive]`, `None` leaves a limit unchanged) and `Connection::set_limits`. moq-tokio and moq-uring re-export it as `quic::Limits`, and both expose `quic::Connection::set_limits(Limits) -> Result<(), quic::Error>`. `Request::quic()` replaces `set_quic_limits` and `Error::QuicLimits`. `[quic] max_streams = 0` is refused, and the connection receive window default resolves in `quic::Config::resolve`, so io_uring workers run the documented 64 MiB instead of 16 MiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`quic::Config::resolve` now fills a 4 MiB per-stream receive window and a 16 MiB send window alongside the 64 MiB connection window, so the tokio, iroh, and io_uring backends run identical windows for the same `[quic]` section instead of each falling back to its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # cpp/obs/src/moq-settings.cpp # go/wrapper/client.go # rs/moq-ffi/src/session.rs
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # rs/moq-relay/src/connection.rs
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe change adds shared validation and live updates for QUIC stream and flow-control limits. Tokio now resolves explicit defaults of 64 MiB for connection receive windows, 4 MiB for stream receive windows, and 16 MiB for send windows, and rejects a stream limit of zero. Relay peer limits use the shared API, and limit-setting errors propagate from accepted connections. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
…5871 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Supersedes #5735, which stays open as a reference draft. This rebuilds the receive-memory bound for
quest/m1/quic/receive-memory.mdaround a receive lease. It also carries the Bun sender, the receive-credit tests, andbenchmark_receive_windowsfrom #5752.What changes
Bytes now stay in the transport, and moq-net never holds credit. A reader leases a stream's unconsumed bytes and returns their credit with
consume(n)once a whole unit is parsed and handed off. The connection window therefore bounds every incomplete header and frame.The connection window can fill with incomplete messages that none can finish. When that happens, the tokio and io_uring drivers evict the lowest-ranked stream, the newest one on a tie. Eviction drops the stream's bytes, returns its credit through MAX_DATA, and fails the stream's next lease with
Evicted. moq-net then stops the stream with its own code. There is no timeout and no new peer signal.Public API
moq-net
transport::poll:RecvStream:poll_read,poll_read_buf,poll_closed,read,read_buf,closed,ReadandReadBuf. A lease withis_finreplaces the end observation.wantbeyond the stream's window is an error, not a wait.Chunksand read throughBuffered, which bounds nothing (documented).CloseKind::Evicted, which maps to the existingError::Evicted.priority::{RECV_CONTROL, recv_group}.RecvStream::poll_leaseandset_priority, anddriver::Lease<'a>. The quic webRecvStreamimplements the moq-net trait natively. Deletedread_held,poll_read_heldanddriver::Credit.quic::RecvStream::poll_leaseandset_priority, andquic::Lease<'a>. DeletedCredit,poll_read_heldand the read-ahead backlog. DeletedConnection::stats(); the stats go through the moq-net trait. AddedError::{Evicted, TooLarge}.RecvStream::{lease, take, consume, set_priority},Leased,LeaseErrorandStreams::leased. Deleted the publicCredit,Chunks::hold(now a privatewithhold) andConnection::release.CreditStatsis now{ leased, available }.Groupedtransport trait (tokio and uring) gainstype Recv; fn recv(...).Configuration:
DEFAULT_RECEIVE_WINDOWand the uring connection window are 128 MiB; they were 64 MiB and 16 MiB.MIN_RECEIVE_WINDOWis refused at config load, including[peer.quic].Wire impact
None to message framing or codes. A receiver may now STOP_SENDING an evicted stream with moq-net's existing
Evictedcode. No draft changes.Receive ranks
i64::MAX.recv_group(subscription priority, group sequence), so the oldest group of the lowest-priority subscription goes first.Benchmarks against main
Each pair was run back to back on the same machine, with branch numbers taken before the latest main merge. Positive numbers mean slower.
session_lite(native lease path)oneshot-54%,all-on-11%,all-off-6%memory(Buffered)receive_stopreceive_lossandreceive_resetframe_recv(Buffered, 1200-byte chunks)upfront256 KiB × 64The
frame_recvslowdown is the per-chunk lease overhead (a VecDeque push and pop) on 1200-byte chunks. The first run also caughtBufferedreading 64 KiB at a time, which split memory-transport frames and copied them, 15-40× slower at 1 MiB; it is fixed here with a regression test.Open decisions
MIN_RECEIVE_WINDOW. Whichever PR lands second reconciles the defaults onto oneConfig::resolve. Recommendation: keep 128 MiB, and let the stream window follow the connection window.i64, so it compares subscription priorities across broadcasts. Ranking within broadcast fairness domains first is a quest follow-up.stop. Mixing a lease and plain reads on one stream is unsupported.Checks
just checkpasses.just test interop --all: see below.🤖 Generated with Claude Code