Jie Yu created MESOS-2279:
-----------------------------

             Summary: Future callbacks should be cleared once the future has 
transitioned.
                 Key: MESOS-2279
                 URL: https://issues.apache.org/jira/browse/MESOS-2279
             Project: Mesos
          Issue Type: Bug
    Affects Versions: 0.21.0, 0.21.1
            Reporter: Jie Yu


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<Nothing> promise;
Future<Nothing> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to