diff --git a/include/grpcpp/impl/codegen/sync_stream.h b/include/grpcpp/impl/codegen/sync_stream.h index 3ed2fddcb8a..aca6079002a 100644 --- a/include/grpcpp/impl/codegen/sync_stream.h +++ b/include/grpcpp/impl/codegen/sync_stream.h @@ -222,7 +222,12 @@ class ClientReader final : public ClientReaderInterface { /// The \a ClientContext associated with this call is updated with /// possible metadata received from the server. grpc::Status Finish() override { - grpc::internal::CallOpSet ops; + grpc::internal::CallOpSet + ops; + if (!context_->initial_metadata_received_) { + ops.RecvInitialMetadata(context_); + } grpc::Status status; ops.ClientRecvStatus(context_, &status); call_.PerformOps(&ops);