From 3904672376a0d69168bc7dcfd9a7407fe41021c5 Mon Sep 17 00:00:00 2001 From: Derek Murray Date: Tue, 3 Sep 2019 08:55:14 -0700 Subject: [PATCH] Add clarifying comment to cancellation handling in rendezvous.cc. PiperOrigin-RevId: 266939120 --- tensorflow/core/framework/rendezvous.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tensorflow/core/framework/rendezvous.cc b/tensorflow/core/framework/rendezvous.cc index aea7006a75b..0543db062f3 100644 --- a/tensorflow/core/framework/rendezvous.cc +++ b/tensorflow/core/framework/rendezvous.cc @@ -266,6 +266,9 @@ class LocalRendezvousImpl : public Rendezvous { Item* item = new Item; if (cm != nullptr) { + // NOTE(mrry): We must wrap `done` with code that deregisters the + // cancellation callback before calling the `done` callback, because the + // cancellation manager may no longer be live after `done` is called. auto wrapped_done = std::bind( [cm, token](const DoneCallback& done, // Begin unbound arguments.