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

grpc / grpc-java / #20366
89%

Build:
DEFAULT BRANCH: master
Ran 27 Jul 2026 06:20AM UTC
Jobs 1
Files 686
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

27 Jul 2026 06:07AM UTC coverage: 89.18% (-0.02%) from 89.199%
#20366

push

github

web-flow
servlet: fix TomcatTransportTest detects write when not ready (#12732)

Fixes #12723 

### What was happening
In `AsyncServletOutputStreamWriter#runOrBuffer`, the application thread
relies on the cached `readyAndDrained `state to determine if it can
write directly to the `ServletOutputStream`.

In highly concurrent scenarios (observed in `TomcatTransportTest`), this
cached state can become stale. The servlet container may have already
transitioned to a 'not ready' state, but the corresponding callback has
not yet updated gRPC's internal state. When the application thread
attempts to write based on the stale `true `value, the container throws
an `IllegalStateException`.

### The Fix
This PR updates the primary execution path in `runOrBuffer` to
explicitly evaluate `isReady.getAsBoolean()` alongside the cached state.

If the cached state is true but the container is actually not ready, the
thread gracefully drops into the `else` block, buffers the action into
the `writeChain`, and attempts to update `readyAndDrained` to `false`.

38275 of 42919 relevant lines covered (89.18%)

0.89 hits per line

Coverage Regressions

Lines Coverage ∆ File
47
0.0
0.0% ../servlet/jakarta/build/generated/sources/jakarta-main/io/grpc/servlet/jakarta/AsyncServletOutputStreamWriter.java
16
76.24
2.01% ../servlet/src/main/java/io/grpc/servlet/AsyncServletOutputStreamWriter.java
5
83.02
-9.43% ../core/src/main/java/io/grpc/internal/Http2Ping.java
2
77.59
-1.72% ../servlet/src/main/java/io/grpc/servlet/ServletServerStream.java
1
84.36
-0.41% ../netty/src/main/java/io/grpc/netty/Utils.java
1
93.21
-0.14% ../okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java
Jobs
ID Job ID Ran Files Coverage
1 #20366.1 27 Jul 2026 06:20AM UTC 686
89.18
Source Files on build #20366
  • Tree
  • List 686
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20366
  • 46f30805 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