aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/training
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <bsteiner@google.com>2016-12-05 17:19:30 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-05 17:43:47 -0800
commit959c0355fb0de2bfcf4057c54d1a8da61d18e59a (patch)
tree34ddecf07e889b57c60f9a1a98f2e76a091ca58f /tensorflow/cc/training
parent22812d55368956b74ccf3afd4c1139458b7b29fb (diff)
Speedup the shutdown of queues by avoiding to run both the cancel and the close
ops since the cancel op will close the queue. Change: 141122341
Diffstat (limited to 'tensorflow/cc/training')
-rw-r--r--tensorflow/cc/training/queue_runner.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/cc/training/queue_runner.cc b/tensorflow/cc/training/queue_runner.cc
index 5d6710ea5c..e703a9bb30 100644
--- a/tensorflow/cc/training/queue_runner.cc
+++ b/tensorflow/cc/training/queue_runner.cc
@@ -166,7 +166,9 @@ void QueueRunner::Run(Session* sess, const string& enqueue_op) {
last_run = (runs_ == 0);
}
- if (IsQueueClosed(status)) {
+ // Close the queue unless the coordinator is shutting down since the cancel op
+ // will be run anway in this case.
+ if (IsQueueClosed(status) && (!coord_ || !coord_->ShouldStop())) {
if (last_run && !close_op_name_.empty()) {
UpdateStatus(sess->Run({}, {}, {close_op_name_}, nullptr));
}