This is an automated email from the ASF dual-hosted git repository.

grag pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 0c5e78bc26653d26a03b08b82923ea517de46fc0
Author: Greg Mann <[email protected]>
AuthorDate: Tue Apr 23 22:25:21 2019 -0700

    Fixed a memory leak in the master's 'removeTask()' helper.
    
    Previously, all removed tasks were added to the
    `slaves.unreachableTasks` map. This patch adds a conditional
    so that removed tasks are only added to that structure when
    they are being marked unreachable.
    
    Review: https://reviews.apache.org/r/70518/
---
 src/master/master.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 3f0c8c0..08a5133 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -11194,7 +11194,10 @@ void Master::removeTask(Task* task, bool unreachable)
               << " on agent " << *slave;
   }
 
-  slaves.unreachableTasks[slave->id].put(task->framework_id(), 
task->task_id());
+  if (unreachable) {
+    slaves.unreachableTasks[slave->id].put(
+        task->framework_id(), task->task_id());
+  }
 
   // Remove from framework.
   Framework* framework = getFramework(task->framework_id());

Reply via email to