Skip to content

fix(quic): recover lost streams with exhausted connection credit - #5

Merged
hatoo merged 1 commit into
masterfrom
codex/fix-h3-retransmit-credit-20261009
Oct 9, 2026
Merged

hatoo merged 1 commit into
masterfrom
codex/fix-h3-retransmit-credit-20261009

Conversation

@hatoo

@hatoo hatoo commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

When a peer's MAX_DATA credit is exhausted, lost request and control-stream bytes currently retry as empty STREAM frames. The peer cannot fill the missing prefix or release more credit, so a request can time out. Pass packet room and fresh-byte credit separately to SendStream::next_send: retransmissions use packet room, fresh bytes remain credit-limited, and data_sent still counts each offset once. This follows RFC 9000 §4.1.

Also clip a late loss notification using its original absolute end after an acknowledged prefix is released. Otherwise, unsent bytes can be misclassified as retransmissions and evade the credit limit. The baseline regression exposes three such bytes.

Validation:

  • Three focused regressions fail on master: bidirectional/unidirectional retransmissions produce zero bytes instead of six; a late loss includes three unsent bytes.
  • Added coverage for zero/small credit, partial retransmissions, packet room, FIN-only recovery, duplicate loss and late ACKs, and a blocked stream ahead of a retransmission.
  • Independent Quinn/h3 peer with a 4 KiB connection window and 8,007-byte POST bodies: controlled loss and delayed-duplicate cases each yield 7 successes/1 timeout on master, versus 8 successes/0 errors with this fix. Body contents, status counts, and every latency sample are checked.
  • cargo fmt --check, strict Clippy, release build, and full debug/release suites pass: 311 unit tests and 51 end-to-end tests per profile; two pre-existing external-server tests remain ignored.
  • The saved 16,391-byte POST / 32-stream held-response fixture also passes with this fix: 1,025 requests plus 33 on a fresh connection, exact bodies/counts/samples. The same fixture on master exceeded a 30-second outer timeout.
  • Frozen release candidate against fixed hfast 86e0502: 102,000 H1/H2/H3 successes, exact status counts, zero request/connection errors.

This is a correctness fix. No throughput gain is claimed; existing WSL measurement limitations remain. The separate experimental sparse-storage and GRO changes are not included.

@hatoo
hatoo enabled auto-merge (squash) October 9, 2026 09:02
@hatoo
hatoo merged commit e09bfd1 into master Oct 9, 2026
4 checks passed
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.

1 participant