From fb8f00c0b35d25511bbd22f38e2ce340ec229cf5 Mon Sep 17 00:00:00 2001 From: Akshay Modi Date: Thu, 11 Apr 2019 11:15:29 -0700 Subject: [PATCH] Return failed status when client not found. PiperOrigin-RevId: 243105084 --- .../core/distributed_runtime/rpc/eager/grpc_eager_client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_client.cc b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_client.cc index 4a8e19dddf7..4e89e302978 100644 --- a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_client.cc +++ b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_client.cc @@ -71,6 +71,10 @@ class GrpcEagerClientCache : public EagerClientCache { if (it == clients_.end()) { tensorflow::SharedGrpcChannelPtr shared = cache_->FindWorkerChannel(target); + if (shared == nullptr) { + return errors::InvalidArgument("Client for target ", target, + " not found."); + } auto worker = std::unique_ptr(new GrpcEagerClient( shared, threads_[AssignClientToThread(target)].completion_queue()));