aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/distributed_runtime/worker_session.cc
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-04-18 15:27:05 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-18 15:30:46 -0700
commit80f60ea37ed77b3dbe1d983f101a5efba2fd4f2e (patch)
treec9a5679baed7ff915eb78ac853f02c62224e4b39 /tensorflow/core/distributed_runtime/worker_session.cc
parente662c3fcfcd03fd091b032a5a33971428f4cdb89 (diff)
Never use the LegacySession when a Master explicitly calls CreateWorkerSession.
Previously, if the session handle was unrecognized by the worker, it would default to using the LegacySession. This prevents us from noticing that a server has been restarted. To address the problem in a backwards-compatible way, we add a bit to each session-handle-carrying worker request, indicating whether the master believes that CreateWorkerSession has been called. If this bit is set and the handle is unrecognized, the worker will raise an AbortedError, which can be caught by high-level frameworks such as `tf.estimator`. Note that CreateWorkerSession is not yet used by default, and a follow-up change will add that. PiperOrigin-RevId: 193427057
Diffstat (limited to 'tensorflow/core/distributed_runtime/worker_session.cc')
-rw-r--r--tensorflow/core/distributed_runtime/worker_session.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/core/distributed_runtime/worker_session.cc b/tensorflow/core/distributed_runtime/worker_session.cc
index cb7059b36e..18886babd5 100644
--- a/tensorflow/core/distributed_runtime/worker_session.cc
+++ b/tensorflow/core/distributed_runtime/worker_session.cc
@@ -97,6 +97,7 @@ WorkerSession::WorkerSession(const string& session_name,
worker_cache(new WorkerFreeListCache(std::move(worker_cache))),
device_mgr(std::move(device_mgr)),
graph_mgr(std::move(graph_mgr)),
- cluster_flr(new ClusterFunctionLibraryRuntime(this)) {}
+ cluster_flr(
+ new ClusterFunctionLibraryRuntime(this, !session_name.empty())) {}
} // namespace tensorflow