• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

grpc / grpc-java / #20543
89%

Build:
DEFAULT BRANCH: master
Ran 26 Oct 2026 12:41PM UTC
Jobs 1
Files 696
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Oct 2026 12:31PM UTC coverage: 89.435% (-0.02%) from 89.451%
#20543

push

github

web-flow
core: Reject retryThrottling without maxTokens or tokenRatio clearly (#13131)

## Problem

`ServiceConfigUtil.getThrottlePolicy()` reads the two required fields of
`retryThrottling` with `JsonUtil.getNumberAsDouble(...).floatValue()`.
When
either field is missing, `getNumberAsDouble` returns null and the call
fails
with an NPE:

Cannot invoke "java.lang.Double.floatValue()" because the return value
of
"io.grpc.internal.JsonUtil.getNumberAsDouble(java.util.Map, String)" is
null

`ScParser` catches it and the channel reports `UNKNOWN: failed to parse
service config`, but the cause doesn't say which field is missing. This
was
noted in the code as `TODO(dapengzhang0): check if this is null.`

## Fix

Check both fields with `checkNotNull(..., "<field> cannot be empty")`,
the
same message used for the required `retryPolicy` and `hedgingPolicy`
fields
in `ManagedChannelServiceConfig`. The exception type is still the NPE
that
`ScParser` already handles, so the only change is a clearer message.

## Testing

Added `getThrottlePolicy_failOnMissingMaxTokens` and
`getThrottlePolicy_failOnMissingTokenRatio` to `ServiceConfigUtilTest`.
Both
failed before the fix with the NPE above.

39396 of 44050 relevant lines covered (89.43%)

0.89 hits per line

Coverage Regressions

Lines Coverage ∆ File
18
82.64
0.5% ../core/src/main/java/io/grpc/internal/ServiceConfigUtil.java
7
96.0
0.1% ../core/src/main/java/io/grpc/internal/ServerCallImpl.java
4
73.27
-3.96% ../servlet/src/main/java/io/grpc/servlet/AsyncServletOutputStreamWriter.java
4
91.59
-1.87% ../xds/src/main/java/io/grpc/xds/client/ControlPlaneClient.java
2
81.05
-2.11% ../okhttp/src/main/java/io/grpc/okhttp/ExceptionHandlingFrameWriter.java
1
90.28
-0.35% ../core/src/main/java/io/grpc/internal/DelayedClientCall.java
1
74.14
-0.86% ../servlet/src/main/java/io/grpc/servlet/ServletServerStream.java
Jobs
ID Job ID Ran Files Coverage
1 #20543.1 26 Oct 2026 12:41PM UTC 696
89.43
Source Files on build #20543
  • Tree
  • List 696
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20543
  • 15d64a46 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc