Skip to content

fix: sync local flow controller initial window with SETTINGS value - #16431

Open
waterWang wants to merge 1 commit into
apache:3.3from
waterWang:fix/http2-flow-control-window-sync
Open

fix: sync local flow controller initial window with SETTINGS value#16431
waterWang wants to merge 1 commit into
apache:3.3from
waterWang:fix/http2-flow-control-window-sync

Conversation

@waterWang

Copy link
Copy Markdown

Problem

The Triple HTTP/2 client advertises a stream window size via SETTINGS (SETTINGS_INITIAL_WINDOW_SIZE) but the local Http2LocalFlowController retains the Netty default of 65,535 bytes. This mismatch causes two failure modes:

  1. 8 MiB window: The Java client tells the PHP server "send up to 8 MiB", the server sends 92 KiB of data, but the local flow controller rejects it with "Flow control window exceeded for stream".
  2. 64 KiB window: The PHP server exhausts the advertised window and waits for a WINDOW_UPDATE, but the client never sends one because the gRPC message cannot be assembled from partial data.

Root Cause

In createHttp2ClientConnection() and createHttp2ServerConnection(), a custom TripleHttp2LocalFlowController is created and attached to the connection, but its initial window size is never updated from the default 65,535 to match the value broadcast in the SETTINGS frame. The local flow controller enforces a smaller window than what was advertised to the peer.

Fix

After attaching the flow controllers, call connection.local().flowController().initialWindowSize(initialWindowSize) to synchronize the local enforcement window with the advertised SETTINGS value. This is applied in both createHttp2ClientConnection() and createHttp2ServerConnection().

Fixes #16427

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.

[Bug] Triple Java client HTTP/2 flow-control failure with PHP gRPC unary response larger than 64 KiB

1 participant