Skip to content

core: normalize service config number values#12826

Open
codingkiddo wants to merge 1 commit into
grpc:masterfrom
codingkiddo:fix/default-service-config-number-values
Open

core: normalize service config number values#12826
codingkiddo wants to merge 1 commit into
grpc:masterfrom
codingkiddo:fix/default-service-config-number-values

Conversation

@codingkiddo
Copy link
Copy Markdown

Fixes #12815

This updates default service config validation to accept numeric values represented as Number, not only Double.

Common JSON parsers may deserialize integer-looking JSON values such as maxAttempts: 4 and backoffMultiplier: 2 as Integer, which previously caused defaultServiceConfig() to fail with IllegalArgumentException.

The values are normalized to Double when copied into the validated service config, preserving the existing internal representation expected by the service config parsing code.

Tests were updated to cover direct and nested integer numeric values.

Tested with:

./gradlew :grpc-core:test --tests io.grpc.internal.ManagedChannelImplBuilderTest \
  -PskipAndroid=true \
  -PskipCodegen=true

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 24, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: codingkiddo / name: Vinod Kumar (6253f6e)

Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
@codingkiddo codingkiddo force-pushed the fix/default-service-config-number-values branch from 6253f6e to 679fdae Compare May 24, 2026 08:26
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.

Service Configuration containing Integer values abort with IllegalArgumentException

1 participant