Repository: mesos
Updated Branches:
  refs/heads/master e31985119 -> f538c4bc2


Added flag in logrotate module to control number of libprocess threads.

Defaults to 8 based on the safe default in libprocess itself.

Review: https://reviews.apache.org/r/50766/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/df1e2313
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/df1e2313
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/df1e2313

Branch: refs/heads/master
Commit: df1e2313127bc441eb38ca939281d97301d9ee32
Parents: e319851
Author: Joris Van Remoortere <joris.van.remoort...@gmail.com>
Authored: Wed Aug 3 18:21:09 2016 -0400
Committer: Joris Van Remoortere <joris.van.remoort...@gmail.com>
Committed: Wed Aug 3 18:22:19 2016 -0400

----------------------------------------------------------------------
 src/slave/container_loggers/lib_logrotate.cpp |  6 ++++++
 src/slave/container_loggers/lib_logrotate.hpp | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/df1e2313/src/slave/container_loggers/lib_logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.cpp 
b/src/slave/container_loggers/lib_logrotate.cpp
index d53847b..1fca486 100644
--- a/src/slave/container_loggers/lib_logrotate.cpp
+++ b/src/slave/container_loggers/lib_logrotate.cpp
@@ -91,6 +91,12 @@ public:
     environment.erase("LIBPROCESS_PORT");
     environment.erase("LIBPROCESS_ADVERTISE_PORT");
 
+    // Use the number of worker threads for libprocess that was passed
+    // in through the flags.
+    CHECK_GT(flags.libprocess_num_worker_threads, 0u);
+    environment["LIBPROCESS_NUM_WORKER_THREADS"] =
+      stringify(flags.libprocess_num_worker_threads);
+
     // NOTE: We manually construct a pipe here instead of using
     // `Subprocess::PIPE` so that the ownership of the FDs is properly
     // represented.  The `Subprocess` spawned below owns the read-end

http://git-wip-us.apache.org/repos/asf/mesos/blob/df1e2313/src/slave/container_loggers/lib_logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.hpp 
b/src/slave/container_loggers/lib_logrotate.hpp
index 8c5602d..193b3ff 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -113,6 +113,20 @@ struct Flags : public virtual flags::FlagsBase
 
           return None();
         });
+
+    add(&libprocess_num_worker_threads,
+        "libprocess_num_worker_threads",
+        "Number of Libprocess worker threads.\n"
+        "Defaults to 8.  Must be at least 1.",
+        8u,
+        [](const size_t& value) -> Option<Error> {
+          if (value < 1u) {
+            return Error(
+                "Expected --libprocess_num_worker_threads of at least 1");
+          }
+
+          return None();
+        });
   }
 
   static Option<Error> validateSize(const Bytes& value)
@@ -134,6 +148,8 @@ struct Flags : public virtual flags::FlagsBase
 
   std::string launcher_dir;
   std::string logrotate_path;
+
+  size_t libprocess_num_worker_threads;
 };
 
 

Reply via email to