Hi Vijay, Thank you very much for the reply!
1. "Finish will always give an ok of 1", I think this is clear and makes perfect sense. This is corresponding to the last "ok" print in my log: Tag received: 0x2419440, Completion queue/Next() returned: 1 HandleEachResponse_FINISH_BAD 2. I read that "ok" document for "Client-Side StartCall/RPC invocation", but I am still confused by such uncertain outcomes. Given the same setup, how does gRPC decide it's never gonna work and simply return ok=0, or send this RPC initiation out on the wire (return ok=1 first) followed by a failure (then ok=0)? From my observation, this decision (if there is any) looks being made randomly with higher weights on the first choice. Is this the design or there is a cause physically such as network fluctuation? Thanks again! On Wednesday, February 7, 2018 at 4:26:21 PM UTC-5, Vijay Pai wrote: > > Hi there, > "ok" is documented at > https://github.com/grpc/grpc/blob/master/include/grpc%2B%2B/impl/codegen/completion_queue.h#L124 > . > > Finish will always give an ok of 1 since it's always ok to be done with > your RPC and check its status. > > When starting an RPC, ok will give 0 only if gRPC is sure that that RPC > will never actually work (see the comments for more detail): the ok of 1 > indicates that gRPC is going to send this RPC initiation out on the wire. > It would be 0 if the channel was permanently broken or the fail-fast option > is set; the call could still end up failing even if the ok were 1 at the > initiation time. > > Hope that helps! > > - Vijay > -- 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/4e533604-5fb0-48fc-9e59-bb6348097c3d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
