----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/23867/#review48760 -----------------------------------------------------------
src/master/detector.cpp <https://reviews.apache.org/r/23867/#comment85506> I don't think WeakFuture is needed here because the reference to the internal Future::Data from the onDiscard callback will be cleared when Self::discard is called, and when the promise is deleted, the internal Future::Data will be freed. src/master/detector.cpp <https://reviews.apache.org/r/23867/#comment85507> This is more cleaner to me, But feel free to ignore:) promise->future() .onDiscard(lambda::bind(discard, promise)) // discard is some helper just do promise->discard(); .onDiscarded(defer(self(), &Self::discarded, promise)); // in discarded, remove the promise from set - Jie Yu On July 24, 2014, 2:55 a.m., Ben Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/23867/ > ----------------------------------------------------------- > > (Updated July 24, 2014, 2:55 a.m.) > > > Review request for mesos, Jie Yu and Jiang Yan Xu. > > > Bugs: MESOS-1529 > https://issues.apache.org/jira/browse/MESOS-1529 > > > Repository: mesos-git > > > Description > ------- > > In order to trigger re-detections in the slave, we need to be able to discard > the Future returned from detect(). This adds discard support to detect(). > > > Diffs > ----- > > src/master/detector.cpp a34cc211941972e2d64802d5c7ed3f5026229744 > src/tests/master_contender_detector_tests.cpp > 231648d3c564f9a38937b844459c08f0fdd66a92 > > Diff: https://reviews.apache.org/r/23867/diff/ > > > Testing > ------- > > Updated the existing tests. > > > Thanks, > > Ben Mahler > >