You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by zh...@apache.org on 2018/08/10 17:57:01 UTC

[mesos] branch master updated (874c752 -> 31699aa)

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

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


    from 874c752  Built gRPC support in mesos-tidy.
     new c57fe98  Replaced `cgroups::DESTROY_TIMEOUT` with new agent flag.
     new 31699aa  Documented new `--cgroups_destroy_timeout` agent option.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/configuration/agent.md                                 | 11 +++++++++++
 src/linux/cgroups.hpp                                       |  6 ------
 src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp |  2 +-
 src/slave/containerizer/mesos/linux_launcher.cpp            |  4 ++--
 src/slave/flags.cpp                                         |  7 +++++++
 src/slave/flags.hpp                                         |  1 +
 6 files changed, 22 insertions(+), 9 deletions(-)


[mesos] 01/02: Replaced `cgroups::DESTROY_TIMEOUT` with new agent flag.

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c57fe98aba809bc415910730a800f534be1ce213
Author: Zhitao Li <zh...@gmail.com>
AuthorDate: Fri Jul 27 11:00:52 2018 -0700

    Replaced `cgroups::DESTROY_TIMEOUT` with new agent flag.
    
    The new agent flag can be used to reconfigure how long a container
    destroy is allowed to take on Mesos containerizer.
    
    Review: https://reviews.apache.org/r/68088
---
 src/linux/cgroups.hpp                                       | 6 ------
 src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp | 2 +-
 src/slave/containerizer/mesos/linux_launcher.cpp            | 4 ++--
 src/slave/flags.cpp                                         | 7 +++++++
 src/slave/flags.hpp                                         | 1 +
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/linux/cgroups.hpp b/src/linux/cgroups.hpp
index 6a6f0e6..282b8e7 100644
--- a/src/linux/cgroups.hpp
+++ b/src/linux/cgroups.hpp
@@ -38,12 +38,6 @@
 
 namespace cgroups {
 
-// Suggested timeout for use with the convenience version of
-// cgroups::destroy(); it is not a default timeout and must be
-// explicitly specified.
-const Duration DESTROY_TIMEOUT = Seconds(60);
-
-
 // Freezing a cgroup may get stuck (see MESOS-1689 for details). To
 // workaround, we may want to thaw the cgroup and retry freezing it.
 // This is the suggested retry interval.
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
index e016d6d..1444c05 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
@@ -1007,7 +1007,7 @@ Future<Nothing> CgroupsIsolatorProcess::_cleanup(
         destroys.push_back(cgroups::destroy(
             hierarchy,
             infos[containerId]->cgroup,
-            cgroups::DESTROY_TIMEOUT));
+            flags.cgroups_destroy_timeout));
 
         break;
       }
diff --git a/src/slave/containerizer/mesos/linux_launcher.cpp b/src/slave/containerizer/mesos/linux_launcher.cpp
index cd677cc..d1f8d3f 100644
--- a/src/slave/containerizer/mesos/linux_launcher.cpp
+++ b/src/slave/containerizer/mesos/linux_launcher.cpp
@@ -637,7 +637,7 @@ Future<Nothing> LinuxLauncherProcess::destroy(const ContainerID& containerId)
   return cgroups::destroy(
       freezerHierarchy,
       cgroup,
-      cgroups::DESTROY_TIMEOUT)
+      flags.cgroups_destroy_timeout)
     .then(defer(
         self(),
         &LinuxLauncherProcess::_destroy,
@@ -669,7 +669,7 @@ Future<Nothing> LinuxLauncherProcess::_destroy(const ContainerID& containerId)
   return cgroups::destroy(
       systemdHierarchy.get(),
       cgroup,
-      cgroups::DESTROY_TIMEOUT);
+      flags.cgroups_destroy_timeout);
 }
 
 
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 58cdc0f..54d9acc 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -533,6 +533,13 @@ mesos::internal::slave::Flags::Flags()
       DEFAULT_MAX_COMPLETED_EXECUTORS_PER_FRAMEWORK);
 
 #ifdef __linux__
+  add(&Flags::cgroups_destroy_timeout,
+      "cgroups_destroy_timeout",
+      "Amount of time allowed to destroy a cgroup hierarchy. If the cgroup\n"
+      "hierarchy is not destroyed within the timeout, the corresponding\n"
+      "container destroy is considered failed.",
+      Seconds(60));
+
   add(&Flags::cgroups_hierarchy,
       "cgroups_hierarchy",
       "The path to the cgroups hierarchy root\n", "/sys/fs/cgroup");
diff --git a/src/slave/flags.hpp b/src/slave/flags.hpp
index eeb9708..88c35da 100644
--- a/src/slave/flags.hpp
+++ b/src/slave/flags.hpp
@@ -99,6 +99,7 @@ public:
   bool strict;
   Duration register_retry_interval_min;
 #ifdef __linux__
+  Duration cgroups_destroy_timeout;
   std::string cgroups_hierarchy;
   std::string cgroups_root;
   bool cgroups_enable_cfs;


[mesos] 02/02: Documented new `--cgroups_destroy_timeout` agent option.

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 31699aabefb50901deeb8e92e83768f59b58b3f5
Author: Zhitao Li <zh...@gmail.com>
AuthorDate: Mon Jul 30 11:07:18 2018 -0700

    Documented new `--cgroups_destroy_timeout` agent option.
    
    Review: https://reviews.apache.org/r/68299
---
 docs/configuration/agent.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/docs/configuration/agent.md b/docs/configuration/agent.md
index 83b5fed..4e50b68 100644
--- a/docs/configuration/agent.md
+++ b/docs/configuration/agent.md
@@ -265,6 +265,17 @@ inside a container. (default: false)
   </td>
 </tr>
 
+<tr id="cgroups_destroy_timeout">
+  <td>
+    --cgroups_destroy_timeout=VALUE
+  </td>
+  <td>
+Amount of time allowed to destroy a cgroup hierarchy. If the cgroup
+hierarchy is not destroyed within the timeout, the corresponding
+container destroy is considered failed. (default: 1mins)
+  </td>
+</tr>
+
 <tr id="cgroups_enable_cfs">
   <td>
     --[no]-cgroups_enable_cfs