Repository navigation
fix(quic): enforce receive limits and RESET credit accounting - #40
Merged
Merged
Conversation
hatoo
enabled auto-merge (squash)
October 21, 2026 11:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QUIC receive streams accepted offsets beyond advertised per-stream credit. Connection-limit checks ran after buffering and completion events, and RESET final sizes spent no connection credit. With an 8-byte window, a 9-byte STREAM was accepted; a RESET from offset 4 to final size 8 left connection accounting at 4.
Validate stream/connection limits and final sizes before state mutation or payload copying, account RESET high-water increases exactly once, and send the appropriate transport close. Keep CRYPTO reassembly independent of stream credit. An unsent MAX_DATA grant now becomes effective only when it fits into a packet, while lost grants preserve their retransmission semantics. Existing fully retired-stream handling is unchanged.
Validation:
This is a correctness/resource repair, with no throughput-improvement claim. Fixed-hfast serial/multiplexed guards completed 27,131,904 requests including warmups with zero unexpected errors. Three alternating pairs plus reversed-order confirmation observed serial RPS +1.183%/-1.861%, multiplexed RPS -2.455%/-2.010%, and multiplexed client CPU/request +1.739%/+0.893%. The small observed cost and WSL2 uncertainty are documented in
benchmarks/quic-receive-limits.md; all latency/error accounting remains enabled.