From reviews-return-91570-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Thu Apr 9 17:57:02 2020 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 05B7A19CC1 for ; Thu, 9 Apr 2020 17:57:01 +0000 (UTC) Received: (qmail 53034 invoked by uid 500); 9 Apr 2020 17:56:58 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 53023 invoked by uid 500); 9 Apr 2020 17:56:58 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 53011 invoked by uid 99); 9 Apr 2020 17:56:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2020 17:56:58 +0000 From: GitBox To: reviews@mesos.apache.org Subject: [GitHub] [mesos] cf-natali commented on a change in pull request #355: Handle EBUSY when destroying a cgroup. Message-ID: <158645501833.29371.7447003164275716142.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Thu, 09 Apr 2020 17:56:58 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit cf-natali commented on a change in pull request #355: Handle EBUSY when destroying a cgroup. URL: https://github.com/apache/mesos/pull/355#discussion_r406378209 ########## File path: src/linux/cgroups.cpp ########## @@ -1535,22 +1629,20 @@ class Destroyer : public Process void remove() { - foreach (const string& cgroup, cgroups) { - Try 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 remove_all = internal::remove(hierarchy, cgroups); + remove_all.onAny(defer(self(), &Destroyer::removed, lambda::_1)); + } + + void removed(const Future& remove_all) Review comment: Done. ---------------------------------------------------------------- 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