Return failed status when client not found.
PiperOrigin-RevId: 243105084
This commit is contained in:
parent
35e39cd3f1
commit
fb8f00c0b3
@ -71,6 +71,10 @@ class GrpcEagerClientCache : public EagerClientCache {
|
|||||||
if (it == clients_.end()) {
|
if (it == clients_.end()) {
|
||||||
tensorflow::SharedGrpcChannelPtr shared =
|
tensorflow::SharedGrpcChannelPtr shared =
|
||||||
cache_->FindWorkerChannel(target);
|
cache_->FindWorkerChannel(target);
|
||||||
|
if (shared == nullptr) {
|
||||||
|
return errors::InvalidArgument("Client for target ", target,
|
||||||
|
" not found.");
|
||||||
|
}
|
||||||
auto worker = std::unique_ptr<EagerClient>(new GrpcEagerClient(
|
auto worker = std::unique_ptr<EagerClient>(new GrpcEagerClient(
|
||||||
shared, threads_[AssignClientToThread(target)].completion_queue()));
|
shared, threads_[AssignClientToThread(target)].completion_queue()));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user