abudnik commented on a change in pull request #355: Handle EBUSY when destroying a cgroup.
URL: https://github.com/apache/mesos/pull/355#discussion_r406270107
##########
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);
+ remove_all.onAny(defer(self(), &Destroyer::removed, lambda::_1));
+ }
+
+ void removed(const Future<Nothing>& remove_all)
Review comment:
`snake_case` is allowed in libprocess only.
Please `s/remove_all/removeAll`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
|