Merge pull request #17278 from yashykt/seq17219

Necessary change after #17219
pull/17288/head
Yash Tibrewal 6 years ago committed by GitHub
commit c79a64d1d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      include/grpcpp/impl/codegen/client_unary_call.h

@ -69,13 +69,17 @@ class BlockingUnaryCallImpl {
ops.ClientSendClose();
ops.ClientRecvStatus(context, &status_);
call.PerformOps(&ops);
if (cq.Pluck(&ops)) {
if (!ops.got_message && status_.ok()) {
status_ = Status(StatusCode::UNIMPLEMENTED,
"No message returned for unary request");
}
} else {
GPR_CODEGEN_ASSERT(!status_.ok());
cq.Pluck(&ops);
// Some of the ops might fail. If the ops fail in the core layer, status
// would reflect the error. But, if the ops fail in the C++ layer, the
// status would still be the same as the one returned by gRPC Core. This can
// happen if deserialization of the message fails.
// TODO(yashykt): If deserialization fails, but the status received is OK,
// then it might be a good idea to change the status to something better
// than StatusCode::UNIMPLEMENTED to reflect this.
if (!ops.got_message && status_.ok()) {
status_ = Status(StatusCode::UNIMPLEMENTED,
"No message returned for unary request");
}
}
Status status() { return status_; }

Loading…
Cancel
Save