Repository navigation
fix(quic): release retired streams after sparse acknowledgements - #26
Merged
Merged
Conversation
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.
When a request's suffix (including FIN) is acknowledged before its prefix,
SendStreamforgets the suffix ACK.SentPacketshas already removed that packet, so a later cumulative ACK cannot supply the missing callback. The fully acknowledged, retired request keeps its stream slot and send buffer until the connection closes.Remember sorted, merged ACK intervals beyond the contiguous prefix, then release them when the earlier gap closes. In-order ACKs allocate no interval storage. Sparse ACKs also remove acknowledged bytes from queued retransmissions; late loss cannot restore acknowledged data or FIN. Reset and pooled-buffer reuse clear the interval state.
Validation:
Connection::on_ackpath processes 512 complete 64 KiB requests, acknowledging each suffix first. Retained completed streams fall from 512 to 0 and their send-buffer capacity from 32 MiB to 0; one 64 KiB buffer remains pooled. With an unacknowledged older stream, only that stream remains live. Baseline/candidate and reversed-order replays give identical counts. Per-stream send state grows from 88 to 112 bytes on x86-64.Network timing guards are recorded below; this is a correctness/resource-retention fix with no throughput or equivalence claim. Small WSL effects remain uncertain.
Reproduce the committed regressions with
cargo test quic::. Network guards usebenchmarks/compare-h3-request-bodies.pyand the unchangedbenchmarks/quic-send-buffer-cases.json, followingbenchmarks/quic-send-buffer.md. Baseline:126d3a4. Local detailed replay sources, manifests, and raw results are indexed by workspace experiment c122.