Allow overriding HTTP/2 maxFrameSize via system property / env var#49417
Merged
jeet1995 merged 6 commits intoJun 8, 2026
Conversation
Adds COSMOS.HTTP2_MAX_FRAME_SIZE_IN_KB system property and COSMOS_HTTP2_MAX_FRAME_SIZE_IN_KB environment variable to override the HTTP/2 SETTINGS_MAX_FRAME_SIZE advertised by ReactorNettyClient. Value is expressed in KB and clamped to [64 KB, 16 MB]; unparseable values fall back to the 64 KB default. Adds unit tests for default, valid override, lower/upper clamp, and unparseable fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use 16383 KB as the customer-facing upper bound so the converted byte value remains below the HTTP/2 SETTINGS_MAX_FRAME_SIZE spec maximum of 2^24 - 1 bytes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the local http2CfgAccessor helper when applying effective HTTP/2 max concurrent streams settings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the HTTP/2 SETTINGS_MAX_FRAME_SIZE that the Cosmos ReactorNettyClient advertises configurable via system property or environment variable, instead of being hard-coded. This fits into the Cosmos gateway HTTP/2 transport configuration surface by allowing customers to tune frame size (e.g., for Gateway HTTP/2 scenarios) while keeping a safe default and enforcing bounds.
Changes:
- Added
Configs.getHttp2MaxFrameSizeInBytes()to resolveCOSMOS.HTTP2_MAX_FRAME_SIZE_IN_KB/COSMOS_HTTP2_MAX_FRAME_SIZE_IN_KB, validate, clamp to[64, 16383]KB, and convert to bytes. - Wired the new config into
ReactorNettyClientHTTP/2 settings via.maxFrameSize(...). - Added unit tests covering default, valid bounds, clamping behavior, and parse-fallback.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/ReactorNettyClient.java | Replaces the hard-coded HTTP/2 max frame size with the new Configs-driven value. |
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java | Introduces the new max-frame-size configuration, including precedence, validation, clamping, and byte conversion. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/ConfigsTests.java | Adds unit coverage for the new configuration behavior. |
kushagraThapar
approved these changes
Jun 8, 2026
Rename CosmosGlobalSecondaryIndexDefinition.getDefinition to getQueryDefinition so the method name matches the documented query definition purpose. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kushagraThapar
approved these changes
Jun 8, 2026
Restore CosmosGlobalSecondaryIndexDefinition.getDefinition and related test references. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/check-enforcer override |
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.
Summary
Fixes #49397
Exposes the HTTP/2
SETTINGS_MAX_FRAME_SIZEadvertised byReactorNettyClientas a customer-tunable setting. Previously the value was hard-coded to 64 KB; this threads it throughConfigsso users can grow the frame size for Gateway HTTP/2.Config
COSMOS.HTTP2_MAX_FRAME_SIZE_IN_KBCOSMOS_HTTP2_MAX_FRAME_SIZE_IN_KB[64, 16383]KBChanges
Configs.getHttp2MaxFrameSizeInBytes()with property/env resolution and validation.ReactorNettyClientHTTP/2 settings.ConfigsTests.http2MaxFrameSizeInBytescoverage for default, valid values, clamping, and parse fallback.