Fix: send connection-level WINDOW_UPDATE at session start #2971
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
@grpc/grpc-js
previously opened every HTTP/2 connection with the RFC‑default 65 535‑byte connection window, then waited until after the first DATA frames were received before enlarging it. On fast, high‑volume streams this small initial window causes the sender (or any intermediate HTTP/2 proxy) to buffer excess data, creating avoidable latency.This change immediately enlarges the connection‑level window as soon as the session is created when the application has requested a larger value via
'grpc-node.flow_control_window'
This aligns the Node implementation with other gRPC language stacks that send the larger window before any payload is transmitted.
Core change (single patch)
No public API changes. Clients that do not set the option keep the existing behaviour.
Impact
Works on Node 14 → 20 (fallback path covers older Node versions).
Changelog entry