Skip to content

mux-h2: the advertised connection-level receive window is not enforced — 106496 octets accepted against 98303, no FLOW_CONTROL_ERROR #1488

Closed

Description

@FlorentinDUBOIS

Sōzu advertises a connection-level receive window and then does not enforce it. RFC 9113 §6.9.1 makes enforcement a MUST.

What exists and what does not

H2FlowControl::window is the send window — peer-granted credit for our sends. The receive side is only H2FlowControl::account_received_bytes, a counter whose job is deciding when to hand credit back with a WINDOW_UPDATE.

Nothing tracks outstanding inbound credit, so nothing can observe it going negative, and no FLOW_CONTROL_ERROR is ever raised at connection level.

Measured

Advertising 98303 octets of connection-level receive window (the 65535 default plus one 32768 grant), then sending DATA past it:

106496 octets accepted, no GOAWAY, no FLOW_CONTROL_ERROR.

Why this is being reported rather than fixed

Back-pressure on this path currently comes from the buffer pool: a peer that outruns the pool gets REFUSED_STREAM, not a flow-control error. That may well be the intended boundary — the pool bounds memory, which is the thing flow control exists to protect, and it does so without per-connection credit bookkeeping.

What is not defensible is advertising a number and not enforcing it. A peer that trusts the advertisement has no way to discover the real limit, and a conformance suite will flag it.

So this is a design call rather than a bug report: either enforce the advertised window and emit FLOW_CONTROL_ERROR, or document that the pool is the real boundary and say what the advertised value means. Both are defensible; the current state is that the code says one thing and does another.

Impact on test coverage

The H2 simulator (#1359 C4) originally carried a property asserting the connection window is never overcommitted. That property is false against today's code, so it was rewritten to assert per-stream credit attribution instead — credit returned equals credit spent, per stream — rather than loosened to pass. The connection-level property is deliberately absent: asserting the current behaviour would certify the gap.

That is the gap this issue exists to close. Once enforcement lands, the original property goes back in.

Provenance

Found by the H2 deterministic simulator (#1359 C4).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions