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

gilbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit c03e51f1fe9cc7137635a7fe586fd890f7c7bdae
Author: Qian Zhang <[email protected]>
AuthorDate: Wed Feb 27 22:22:24 2019 -0800

    Deallocated the shared persistent volume's gid when it is removed.
    
    Review: https://reviews.apache.org/r/69481/
---
 src/slave/slave.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 3b7870a..e58684a 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -4398,7 +4398,6 @@ Try<Nothing> Slave::syncCheckpointedResources(
 
       // We should proceed only if the directory is removed.
       Try<Nothing> result = os::rmdir(path, true, removeRoot);
-
       if (result.isError()) {
         return Error(
             "Failed to remove persistent volume '" +
@@ -4406,6 +4405,15 @@ Try<Nothing> Slave::syncCheckpointedResources(
             "' at '" + path + "': " + result.error());
       }
     }
+
+#ifndef __WINDOWS__
+    // Deallocate the shared persistent volume's gid. Please note that the
+    // gid is allocated when the shared persistent volume is first used by
+    // a container rather than when it is created.
+    if (volume.has_shared() && volumeGidManager) {
+      volumeGidManager->deallocate(path);
+    }
+#endif // __WINDOWS__
   }
 
   return Nothing();

Reply via email to