This is an automated email from the ASF dual-hosted git repository. grag pushed a commit to branch 1.8.x in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 6f90cc334701fad10e721312cd4cbd0690e1c6ec 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 5488b7b..9730e65 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -11780,7 +11780,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());
