diff options
Diffstat (limited to 'tensorflow/core/common_runtime/ring_reducer.cc')
-rw-r--r-- | tensorflow/core/common_runtime/ring_reducer.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tensorflow/core/common_runtime/ring_reducer.cc b/tensorflow/core/common_runtime/ring_reducer.cc index b48011cce4..c1e514d5ad 100644 --- a/tensorflow/core/common_runtime/ring_reducer.cc +++ b/tensorflow/core/common_runtime/ring_reducer.cc @@ -447,10 +447,11 @@ bool RingReducer::RunAsyncParts() { if (rf->do_recv) { rf->action = RF_RECV; auto requeue = [this, rf, &ready_queue, &aborted](Status s) { - const bool bad_status = !s.ok(); - if (bad_status) aborted = true; + if (!s.ok()) { + aborted = true; + StartAbort(s); + } ready_queue.Enqueue(rf); - if (bad_status) StartAbort(s); }; DispatchRecv(rf, requeue); dispatched = true; @@ -495,10 +496,11 @@ bool RingReducer::RunAsyncParts() { if (rf->do_send) { rf->action = RF_SEND; auto send_complete = [this, rf, &ready_queue, &aborted](Status s) { - const bool bad_status = !s.ok(); - if (bad_status) aborted = true; + if (!s.ok()) { + aborted = true; + StartAbort(s); + } ready_queue.Enqueue(rf); - if (bad_status) StartAbort(s); }; DispatchSend(rf, send_complete); dispatched = true; |