Skip to content

Document receive window configuration with automatic flow control - #1349

Open
FFspiky wants to merge 1 commit into
python-hyper:masterfrom
FFspiky:docs/configure-receive-windows
Open

FFspiky wants to merge 1 commit into
python-hyper:masterfrom
FFspiky:docs/configure-receive-windows

Conversation

@FFspiky

@FFspiky FFspiky commented Nov 11, 2026

Copy link
Copy Markdown

Document configuring receive windows with automatic flow control

Refs #1280.

The automatic flow-control guide explains acknowledging processed data but does not explain how to enlarge the connection receive window while retaining automatic replenishment. The existing increment_flow_control_window() already raises the window manager's maximum when the resulting current window exceeds it.

Document a one-time startup increment to a 1 MiB connection window, separate 256 KiB stream settings, SETTINGS acknowledgement timing, and subsequent replenishment through acknowledge_received_data(). Explain the difference between an increment and a target, the current and maximum windows, and the protocol limits. Add the same clarification to the increment method's API documentation. This introduces no API or runtime behavior change.

Add 24 frame-level cases using two in-memory peers, with either client or server receiving. They compare default and enlarged connection ACK thresholds over repeated cycles, include padded DATA, check exact WINDOW_UPDATE and SETTINGS/ACK bytes, distinguish connection/stream and send/receive windows, exercise existing and new streams, reach the maximum window without allocating a maximum-sized payload, and cover zero/negative acknowledgements, invalid increments, and negative stream credit after a SETTINGS decrease.

Validation on macOS arm64, CPython 3.12.14:

  • Baseline: 1,684 passed, 100% statement and branch coverage.
  • Final: 1,708 passed, 100% statement and branch coverage.
  • All 24 added cases also pass against the original runtime: this clarifies and protects existing behavior.
  • A separate mutation disabling maximum-window growth causes six new cases to fail.
  • Ruff source/new-test checks, strict-bytes mypy, Sphinx HTML with warnings as errors, and execution of the exact documentation example pass.

The full Python matrix and h2spec were not run locally. No network throughput benchmark is claimed. Prepared with AI assistance; external review has not occurred.

Explain startup connection increments and independent stream settings, backed by frame-level coverage of replenishment and protocol limits.

Refs python-hyper#1280.

Assisted-by: Codex
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