Skip to content

fix(qmux): return receive credit and flush close on 0.5 - #413

Closed
kixelated wants to merge 2 commits into
qmux-v0.5.xfrom
codex/qmux-credit-05
Closed

kixelated wants to merge 2 commits into
qmux-v0.5.xfrom
codex/qmux-credit-05

Conversation

@kixelated

@kixelated kixelated commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

qmux 0.5.2 leaks connection credit when receive streams are discarded unread. STOP_SENDING retirement loses later STREAM bytes and RESET final-size gaps. A local close can interrupt a pending write and drop APPLICATION_CLOSE.

Approach

Backport the receive-credit ownership and bounded graceful-close fix from #412, using 0.5's existing Writer::send contract. Retain stopped accounting until peer FIN/RESET, share stream-count ownership until both sides finish, and register the first receive frame before exposing the accepted stream. Preserve the first requested close and drain it within one second.

Impact

  • Public API: no signatures, exports, or dependency requirements changed; web-transport-trait stays on 0.4.
  • Wire format: unchanged. Correct MAX_DATA replenishment and close delivery; MAX_STREAMS waits for application drop and peer termination.

Validation

  • cargo test -p qmux --all-features: 145 unit tests, 33 integration tests, and 3 doctests passed using MoQ's pinned Nix toolchain.
  • New paused-time tests cover unread drops, partial reads, stopped data/reset gaps, flow-control enforcement, retained-state bounds, close during a pending write, and the close deadline.
  • End-to-end byte-stream tests cover drafts 00, 01, and 02. All tests run through this branch's existing CI recipes.
  • Focused Clippy (cargo clippy -p qmux --all-targets --all-features -- -D warnings) passed. The two end-to-end regressions fail against unmodified 0.5.2. Repository-wide checks and CI remain pending.

Alternatives

Do not carry 0.6's batching or transport-trait API changes into the compatible 0.5 line. Immediate retirement or teardown loses accounting or the close frame.

Follow-ups

Merge and publish a qmux 0.5.x release newer than 0.5.2, then update MoQ main's pin. The release workflow runs only on main, so the 0.5 release needs the existing maintainer release process. #412 covers the 0.6 line. No release or merge is performed by this PR.

(written by GPT-6)

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Source fixes and focused validation are complete on both lines: #412 (0.6) and #413 (0.5). The end-to-end unread-stream and close-delivery regressions both fail on unmodified 0.5.2 and pass with the fixes. Suites pass 189 tests on 0.6 and 181 on 0.5, including doctests; focused Clippy passes on 0.5, and workspace native check/Clippy passed on 0.6 using MoQ's pinned Nix toolchain.

Full checks with web-transport's own pinned Rust 1.94 toolchain and PR CI remain pending. The first broad run with MoQ's newer Clippy failed on the existing WASM harness chunks_exact_to_as_chunks lint. Both PRs remain drafts. No public API or wire-format changes.

MoQ progress is tracked in moq-dev/moq#4705. The remaining blocker is maintainer review/merge and publication of both patched release lines, then MoQ main/dev pin updates. No packages were published and no PRs were merged. Recommendation: finish upstream CI/review, merge/release both lines, then resume the pin steps.

(written by GPT-6)

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Final sources are pushed: #412 at 82527d2 and #413 at 1adcb9c. Complete qmux tests and focused Clippy pass on these sources: 189 tests on 0.6 and 181 on 0.5, including doctests. The last guard preserves the legacy binding's lack of flow control. Both end-to-end regressions fail against unmodified qmux 0.5.2.

The newly published qmux 0.6.2 contains the earlier receive-map lookup fix, not these credit/close fixes. MoQ must consume releases containing #412/#413 after review and merge. Broad checks with web-transport's pinned Rust 1.94 toolchain and latest-head CI remain pending. All PRs remain drafts; no packages were published or PRs merged by this work.

Recommendation: complete upstream checks/review, merge/release both lines, then resume MoQ main/dev pin updates tracked in moq-dev/moq#4705. No unresolved API or wire choices.

(written by GPT-6)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Closing: QMux development has moved to moq-dev/moq. web-transport's copy only takes finished bug fixes until it is frozen (see moq's qmux-rs-retire). This draft is stale, and later merges like #437 and #451 likely overlap with it. Any remaining issue belongs in moq-dev/moq's qmux.

(Written by Claude Opus 5.5 with high)

@kixelated kixelated closed this Nov 8, 2026
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