You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Alexander Rojas (JIRA)" <ji...@apache.org> on 2016/10/31 11:26:58 UTC

[jira] [Assigned] (MESOS-6484) Memory leak in `Future::after()`

     [ https://issues.apache.org/jira/browse/MESOS-6484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Rojas reassigned MESOS-6484:
--------------------------------------

    Assignee: Alexander Rojas

> Memory leak in `Future<T>::after()`
> -----------------------------------
>
>                 Key: MESOS-6484
>                 URL: https://issues.apache.org/jira/browse/MESOS-6484
>             Project: Mesos
>          Issue Type: Bug
>          Components: libprocess
>    Affects Versions: 1.1.0
>            Reporter: Alexander Rojas
>            Assignee: Alexander Rojas
>              Labels: libprocess, mesosphere
>
> The problem arises when one tries to associate an {{after()}} call to copied futures. The following test case is enough to reproduce the issue:
> {code}
> TEST(FutureTest, After3)
> {
>   auto policy = std::make_shared<int>(0);
>   {
>     auto generator = []() {
>       return Future<Nothing>();
>     };
>     Future<Nothing> future = generator()
>       .after(Milliseconds(1),
>         [policy](const Future<Nothing>&) {
>            return Nothing();
>         });
>     AWAIT_READY(future);
>   }
>   EXPECT_EQ(1, policy.use_count());
> }
> {code}
> In the test, one would expect that there is only one active reference to {{policy}}, therefore the expectation {{EXPECT_EQ(1, policy.use_count())}}. However, if after is triggered more than once, each extra call adds one undeleted reference to {{policy}}.



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