Repository navigation
Conversation
Motivation A paused request or response body can tie up a connection's receive credit and delay another stream on the same connection. Modification Add a default-off setting for the number of paused streams to budget for. Keep aggregate receive credit within the configured connection buffer budget, bound each stream to a share, and replenish only from space that is neither buffered nor already credited. Validate the unavoidable initial HTTP/2 window without changing SETTINGS semantics. Result Applications can leave receive space for independent streams without bypassing the connection budget or changing default behavior. Tests Check client and server frame-level credit and body completion, concurrent calls through the public TLS HTTP/2 APIs, configuration validation and arithmetic boundaries. References RFC 9113 sections 6.9.1 and 6.9.2; Netty #4423 for the motivation.
pjfanning
reviewed
Nov 26, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
Some concerns:
- The isolation tests don't seem to show isolation. In the server/client "isolate connection receive credit from a paused request body" tests, stream 1 sends 3 × 14336 = 43008 bytes, leaving 22527 bytes of connection window even under the default controller, so stream 3's 11 bytes get through either way. Only the WINDOW_UPDATE/remaining-window assertions depend on the feature. To show the default starves stream 3, the paused stream needs to exhaust the connection window.
Http2ClientServerSpec"carry independent HTTP/2 calls through isolated receive windows" uses default buffers and a few bytes, so it passes identically with the option off.- The user-facing option is stored in the
internalSettingsslot, so anywithInternalSettings(...)call drops it, and it collides with #981/#1556. - No
withIncomingFlowControlIsolatedStreams(or similar) in the Scala/Java settings, unlike neighbouring settings — config-only breaks DSL parity. - With default sizes one paused stream can't starve the connection under the current policy. Would fixing the default refill rule be preferable to a new knob?
- Nits:
flowControllerchanges fromdeftolazy val(unrelated); the pureIncomingFlowController.isolatedarithmetic test would fit better in its own spec than inHttp2ServerDemuxSpec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
A paused HTTP/2 stream can tie up connection receive credit and delay an independent exchange on the same connection. Netty offers connection-window auto-refill for this use case. Pekko HTTP should offer an opt-in without disabling aggregate receive accounting.
Modification
Add default-off
incoming-flow-control-isolated-streamson both client and server. Reserve a share for an additional stream by limiting each stream to a share of the existing connection budget. Replenish only unbuffered, ungranted capacity. Validate the unavoidable initial HTTP/2 window and retain the existing default path and settings product shape.Result
Application pause on a configured number of streams need not exhaust receive credit for another admitted, consuming stream. The bound is for flow-control-accounted receive buffers and granted credit, not total process memory, queued dispatched entities, or arbitrary application waits. Fits applications including the Pekko HTTP transport used by Pekko gRPC; it does not change the Netty gRPC client backend.
Tests
JDK 17, Scala 2.13.18 and Scala 3.3.9: 9 focused tests each, covering connection-credit arithmetic, configuration/defaults, client/server behavior, h2c and a public TLS HTTP/2 loopback with concurrent exchanges. MiMa on both versions, released JVM constructor/copy and Java DSL checks, formatting, Paradox and independent review passed. Full CI, external h2spec and a generated gRPC-service integration were not run locally.
Integration
If #981 or #1556 lands first, compose their internal settings carriers and retest combined options during rebase.
References
Netty #4423 and RFC 9113 §5.2.