Hi there,

Wanted to give a detailed reply to this question (though a bit late) since 
it has come up numerous times. This is for the C++ API.

Server-side request an RPC: ok indicates that the RPC has indeed been 
started. If it is false, the server has been Shutdown before this 
particular call got matched to an incoming RPC. This is actually the case 
that you were interested in, but I've gone ahead and documented the other 
cases below.

Client-side start an RPC: ok indicates that the RPC is going to go to the 
wire. If it is false, it not going to the wire. This would happen if the 
channel is either permanently broken or transiently broken but with the 
fail-fast option.

Client-side Write, Client-side WritesDone, Server-side Write, Server-side 
Finish, Server-side SendInitialMetadata (which is typically included in 
Write or Finish when not done explicitly): ok means that the 
data/metadata/status/etc is going to go to the wire. If it is false, it not 
going to the wire because the call is already dead (i.e., canceled, 
deadline expired, other side dropped the channel, etc).

Client-side Read, Server-side Read, Client-side RecvInitialMetadata (which 
is typically included in Read if not done explicitly): ok indicates whether 
there is a valid message that got read. If not, you know that there are 
certainly no more messages that can ever be read from this stream.

Client-side Finish: ok should always be true

Server-side AsyncNotifyWhenDone: ok should always be true

HTH!

- Vijay


On Friday, August 18, 2017 at 2:17:35 PM UTC-7, Arpit Baldeva wrote:
>
> Hi,
>
> In async model, from my experiments, when server shuts down, 'ok' will be 
> false. Is there any other scenario in which it can be false? 
>
> When the server is shutting down, I don't want to queue up another rpc 
> request. But if the 'ok' boolean can be false in some other scenario(is 
> there a concrete example?), I'd want to queue up another request.  
>
> Thanks.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d35636b1-8fa2-40fd-b6b2-783d24e56eb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to