From 566f16ea0b1813f18823fc55d44106870ddaa1b3 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 2 Nov 2020 20:13:36 +0100 Subject: [PATCH] api: Clarify expectations regarding ServerCall#close (#7580) --- api/src/main/java/io/grpc/ServerCall.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/main/java/io/grpc/ServerCall.java b/api/src/main/java/io/grpc/ServerCall.java index 93d76dca07d..d391cb5c79a 100644 --- a/api/src/main/java/io/grpc/ServerCall.java +++ b/api/src/main/java/io/grpc/ServerCall.java @@ -163,6 +163,13 @@ public boolean isReady() { *

Since {@link Metadata} is not thread-safe, the caller must not access (read or write) {@code * trailers} after this point. * + *

This method implies the caller completed processing the RPC, but it does not imply the RPC + * is complete. The call implementation will need additional time to complete the RPC and during + * this time the client is still able to cancel the request or a network error might cause the + * RPC to fail. If you wish to know when the call is actually completed/closed, you have to use + * {@link Listener#onComplete} or {@link Listener#onCancel} instead. This method is not + * necessarily invoked when Listener.onCancel() is called. + * * @throws IllegalStateException if call is already {@code close}d */ public abstract void close(Status status, Metadata trailers);