Repository navigation
fix: report gRPC deadline races as cancellations - #1624
Merged
Merged
Conversation
jlouvel
force-pushed
the
fix/grpc-call-slot-before-close
branch
from
November 1, 2026 21:21
f73794b to
4a26625
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The user-visible status-code change from UNAVAILABLE to DEADLINE_EXCEEDED is missing from the 3.0 Milestone 2 bug fixes in changes.md.
1 open issue
What changed in this PR
This follow-up adjusts the Restlet gRPC client’s deadline-race handling so expired calls report DEADLINE_EXCEEDED rather than UNAVAILABLE, building on the separately merged call-slot fix.
Changes:
- Map transport failures after deadline expiry to cancellation and add regression tests.
- Add an executor getter and null-safety-related adjustments.
- Warm up deadline tests to reduce cold-start timing failures.
| File | Description |
|---|---|
org.restlet.ext.grpc/src/test/java/org/restlet/ext/grpc/internal/RestletClientStreamTestCase.java |
Adds deadline-status tests and shared helpers. |
org.restlet.ext.grpc/src/test/java/org/restlet/ext/grpc/GrpcModuleTestCase.java |
Updates compiler invocation and diagnostic handling. |
org.restlet.ext.grpc/src/test/java/org/restlet/ext/grpc/GrpcHttpValidationTestCase.java |
Adds explicit null checks to status assertions. |
org.restlet.ext.grpc/src/test/java/org/restlet/ext/grpc/GrpcClientAdapterTestCase.java |
Adds warm-up calls and checks trailer availability. |
org.restlet.ext.grpc/src/main/java/org/restlet/ext/grpc/internal/RestletClientStream.java |
Tracks deadlines and maps expired transport failures to cancellation. |
org.restlet.ext.grpc/src/main/java/org/restlet/ext/grpc/internal/GuardedClientStream.java |
Suppresses null-analysis warnings. |
org.restlet.ext.grpc/src/main/java/org/restlet/ext/grpc/GrpcClientAdapter.java |
Exposes the configured callback executor through a getter. |
Review effort: Balanced
Pair setExecutor with getExecutor, so that every GrpcClientAdapter setting has a getter, following the Restlet API conventions used across the RPC extensions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jerome Louvel <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jerome Louvel <[email protected]>
When the client deadline expires, the grpc-java peer resets the stream with CANCEL, and the Restlet HTTP/2 client reports it as a closed connection. Report such failures after the deadline as CANCELLED, like grpc-netty, so that the SDK call turns them into DEADLINE_EXCEEDED instead of UNAVAILABLE. Make a first call in the deadline tests before the timed call, so that class loading and the HTTP/2 connection no longer exhaust their 3-second deadlines in a cold JVM. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jerome Louvel <[email protected]>
jlouvel
force-pushed
the
fix/grpc-call-slot-before-close
branch
from
November 2, 2026 02:02
4a26625 to
2b9209e
Compare
|
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.




Follow-up to #1563 and #1623. The call-slot release that this PR first contained was merged with #1623, so this PR now keeps only the deadline and null-safety changes.
Changes
RestletClientStream, deadline races: when the client deadline expires, the grpc-java peer resets the stream with CANCEL, and the Restlet HTTP/2 client reports a closed connection. Such failures after the deadline are now reported as CANCELLED, like grpc-netty, so the SDK call ends with DEADLINE_EXCEEDED instead of UNAVAILABLE.GrpcClientAdapter.getExecutor(): pairs the existingsetExecutor(), so every setting has a getter.GuardedClientStream,RestletClientStreamand the tests.RestletClientStreamTestCasecovers the deadline races, with helpers shared by its tests.GrpcClientAdapterTestCasemake a first call before the timed one, so class loading and the HTTP/2 connection no longer use up their 3-second deadline in a cold JVM.Validation
./mvnw -B -pl org.restlet.ext.grpc -P default,test verifypasses (tests, coverage, SpotBugs).🤖 Generated with Claude Code