Repository: mesos
Updated Branches:
  refs/heads/master 9e2f9a240 -> 2c5da1b66


Detached `virtualLatestPath` when recovering the executor.

Previously we miss to detach `/frameworks/FID/executors/EID/runs/latest`
when we find the latest run of the executor was completed in the method
`Framework::recoverExecutor`, that is a leak.

Review: https://reviews.apache.org/r/65167


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2c5da1b6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2c5da1b6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2c5da1b6

Branch: refs/heads/master
Commit: 2c5da1b668de91e33831caafb18a3b4d71b26c69
Parents: 9585a21
Author: Qian Zhang <[email protected]>
Authored: Mon Jan 15 16:40:00 2018 +0800
Committer: Qian Zhang <[email protected]>
Committed: Wed Jan 17 10:04:30 2018 +0800

----------------------------------------------------------------------
 src/slave/slave.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2c5da1b6/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 45e6f9b..1672c06 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -8656,7 +8656,10 @@ void Framework::recoverExecutor(
     // GC the top level executor work directory.
     slave->garbageCollect(paths::getExecutorPath(
         slave->flags.work_dir, slave->info.id(), id(), state.id))
-        .onAny(defer(slave, &Slave::detachFile, latestPath));
+        .onAny(defer(slave->self(), [=](const Future<Nothing>& future) {
+          slave->detachFile(latestPath);
+          slave->detachFile(virtualLatestPath);
+        }));
 
     // GC the top level executor meta directory.
     slave->garbageCollect(paths::getExecutorPath(

Reply via email to