You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2018/09/05 23:54:12 UTC

[mesos] 01/06: Enabled garbage collection of terminated tasks' metadata.

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

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

commit f7416e79f593bfc2e3a7658697f1d0c104e2c2bd
Author: Joseph Wu <jo...@apache.org>
AuthorDate: Tue Jul 24 13:43:29 2018 -0700

    Enabled garbage collection of terminated tasks' metadata.
    
    This commit schedules tasks' metadata, whose terminal statuses have been
    acknowledged, for garbage collection.  GC occurs according to the
    existing GC policy (controlled by agent flags --gc_delay and
    --gc_disk_headroom).  This change helps mitigate potential accumulation
    of directories for long-lived, multi-task executors, such as the
    default executor.
    
    Review: https://reviews.apache.org/r/68065
---
 src/slave/slave.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 8255f0a..7425cfb 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -9667,6 +9667,19 @@ void Executor::completeTask(const TaskID& taskId)
     slave->detachTaskVolumeDirectories(info, containerId, {*firstTask});
   }
 
+  // Mark the task metadata (TaskInfo and status updates) for garbage
+  // collection. This is important for keeping the metadata of long-lived,
+  // multi-task executors within reasonable levels.
+  if (checkpoint) {
+    slave->garbageCollect(paths::getTaskPath(
+        slave->metaDir,
+        slave->info.id(),
+        frameworkId,
+        id,
+        containerId,
+        taskId));
+  }
+
   Task* task = terminatedTasks[taskId];
   completedTasks.push_back(shared_ptr<Task>(task));
   terminatedTasks.erase(taskId);