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

Future::then and Promise::associate have memory leaks.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.16.0
    • Fix Version/s: 0.17.0
    • Component/s: None
    • Labels:
      None

      Description

      As commented in Future::then, there is a memory leak (cyclic dependency). Recently, the change in Promise::associate (https://issues.apache.org/jira/browse/MESOS-807) makes it worse.

      // TODO(benh): Need to pass 'future' as a weak_ptr so that we can
      // avoid reference counting cycles!
      std::tr1::function<void(void)> discard =
      std::tr1::bind(&Future<T>::discard, *this);

      promise->future().onDiscarded(discard);

        Attachments

          Activity

            People

            • Assignee:
              jieyu Jie Yu
              Reporter:
              jieyu Jie Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: