Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-2279

Future callbacks should be cleared once the future has transitioned.

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.21.0, 0.21.1
    • 0.22.0
    • None
    • None
    • Twitter Mesos Q1 Sprint 1
    • 2

    Description

      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:

      Promise<Nothing> promise;
      Future<Nothing> f = promise.future();
      f.onDiscard(lambda::bind(&SomeFunc, f));
      promise.set(Nothing());
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            vinodkone Vinod Kone
            jieyu Jie Yu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Agile

                Completed Sprint:
                Twitter Mesos Q1 Sprint 1 ended 02/Feb/15
                View on Board

                Slack

                  Issue deployment