You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Jie Yu (JIRA)" <ji...@apache.org> on 2015/01/27 22:38:35 UTC

[jira] [Created] (MESOS-2279) Future callbacks should be cleared once the future has transitioned.

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)