Skip to content

fix: harden mux lifecycle, framing, and backpressure - #9

Merged
black-binary merged 2 commits into
mainfrom
codex/harden-mux-state-machine
Sep 3, 2026
Merged

black-binary merged 2 commits into
mainfrom
codex/harden-mux-state-machine

Conversation

@black-binary

Copy link
Copy Markdown
Owner

Summary

  • preserve accepted stream writes and enforce carrier-level flush plus PSH-before-FIN ordering
  • make orderly connection close release the carrier, reject late work, avoid read/write waker races, and wake concurrent close callers safely
  • enforce hard TX/RX queue bounds, include queued accepts and closed-stream payloads, and suspend keepalive expiry while RX is intentionally backpressured
  • reject malformed control/reserved-ID frames without oversized decoder preallocation
  • handle empty I/O correctly, reap idle accepts, report only open streams, and strengthen CI checks

Test-first coverage

Regression tests were added before each implementation fix and reproduced the failures around close, cancellation, flush, FIN ordering, queue limits, keepalive, malformed frames, empty I/O, and resource cleanup. The suite now contains 48 tests, including deterministic custom transports for shutdown and waker races.

Validation

  • cargo test --all-features: 48 passed
  • cargo test --lib --release: 48 passed
  • cargo test --lib -- --test-threads=1: 48 passed
  • cargo fmt --all -- --check
  • cargo clippy --lib --tests --examples --all-features -- -D warnings
  • RUSTDOCFLAGS=-D warnings cargo doc --no-deps --all-features
  • git diff --check

Add regression coverage for shutdown, flushing, queue bounds, keepalive, frame validation, and stream lifecycle edge cases. Preserve accepted writes, enforce real flush/FIN ordering, bound receive work, and make concurrent close cancellation-safe.
@black-binary
black-binary merged commit 059623d into main Sep 3, 2026
1 check 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