Project: mesos
Issue MESOS-2279: Future callbacks should be cleared once the future has transitioned.
For example, when a future has transitioned into READY state, all onDiscard callbacks should be cleared to avoid potential cyclic dependency and memory leak. For instance: {noformat} Promise promise; Future f = promise.future(); f.onDiscard(lambda::bind(&SomeFunc, f)); promise.set(Nothing()); {noformat} The above code has a cyclic dependency because f.data has a reference to the future inside an std::function which has a reference to f.data.
Story points: 2