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

grpc / grpc-java / #20247
89%

Build:
DEFAULT BRANCH: master
Ran 22 Apr 2026 12:38PM UTC
Jobs 1
Files 647
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

22 Apr 2026 12:26PM UTC coverage: 88.799% (-0.006%) from 88.805%
#20247

push

github

web-flow
Cancel DelayedClientCall when application listener throws (#12761)

Align DelayedClientCall.DelayedListener with ClientCallImpl's existing
behavior for listener exceptions. When the application listener throws
from onHeaders/onMessage/onReady, catch the Throwable, cancel the call
with CANCELLED (cause = the throwable), and swallow subsequent
callbacks. When onClose throws, log and continue, matching
ClientCallImpl.closeObserver. If onClose arrives from the transport
after a prior callback threw, override its status/trailers with the
captured CANCELLED so a server-supplied OK can't mask the local failure.

Previously, a throw from the application listener escaped to the
callExecutor's uncaught-exception handler. The real call was not
cancelled and the transport kept delivering callbacks to an already
broken listener, different from how the same bug behaves on a normal
ClientCallImpl, and a timing-dependent inconsistency depending on
whether callbacks arrived before or after setCall + drain completed.

Trade-off: listener-callback throws are no longer visible to the
executor's UncaughtExceptionHandler (they're attached as Status.cause
instead). This matches ClientCallImpl and is the intended behavior.

Exception handling for the outer drainPendingCalls loop
(realCall.sendMessage/request/halfClose/cancel) remains unaddressed;
that TODO is preserved.

**Note:**
This change only handles exceptions thrown by the application listener.
I don't try and solve the problems that #12737 is attempting to fix. My
motivation is to fix the root cause behind
https://github.com/bazelbuild/bazel/pull/29316

---------

Co-authored-by: Kannan J <kannanjgithub@google.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

36049 of 40596 relevant lines covered (88.8%)

0.89 hits per line

Coverage Regressions

Lines Coverage ∆ File
5
90.21
2.07% ../core/src/main/java/io/grpc/internal/DelayedClientCall.java
5
75.0
-3.45% ../servlet/src/main/java/io/grpc/servlet/ServletServerStream.java
3
93.22
-1.69% ../core/src/main/java/io/grpc/internal/AbstractClientStream.java
3
92.38
-1.43% ../xds/src/main/java/io/grpc/xds/client/ControlPlaneClient.java
1
95.5
-0.15% ../core/src/main/java/io/grpc/internal/RetriableStream.java
1
84.3
-0.41% ../netty/src/main/java/io/grpc/netty/Utils.java
1
96.55
-0.57% ../xds/src/main/java/io/grpc/xds/client/LoadReportClient.java
Jobs
ID Job ID Ran Files Coverage
1 #20247.1 22 Apr 2026 12:38PM UTC 647
88.8
Source Files on build #20247
  • Tree
  • List 647
  • Changed 10
  • Source Changed 0
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20247
  • 7561d0b6 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc