abudnik commented on a change in pull request #355: Handle EBUSY when 
destroying a cgroup.
URL: https://github.com/apache/mesos/pull/355#discussion_r406268132
 
 

 ##########
 File path: src/linux/cgroups.cpp
 ##########
 @@ -1535,22 +1629,20 @@ class Destroyer : public Process<Destroyer>
 
   void remove()
   {
-    foreach (const string& cgroup, cgroups) {
-      Try<Nothing> remove = cgroups::remove(hierarchy, cgroup);
-      if (remove.isError()) {
-        // If the `cgroup` still exists in the hierarchy, treat this as
-        // an error; otherwise, treat this as a success since the `cgroup`
-        // has actually been cleaned up.
-        if (os::exists(path::join(hierarchy, cgroup))) {
-          promise.fail(
-              "Failed to remove cgroup '" + cgroup + "': " + remove.error());
-          terminate(self());
-          return;
-        }
-      }
+    Future<Nothing> remove_all = internal::remove(hierarchy, cgroups);
 
 Review comment:
   I think we don't need to use `remove_all` variable here. Also, we can get 
rid of the `void remove()` method. So the only call-site of `remove()` will 
look like this:
   ```c++
   // instead of calling `remove()` method
   internal::remove(hierarchy, cgroups)
     .onAny(defer(self(), &Destroyer::removed, lambda::_1));
   ``` 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to