You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/08/03 22:51:06 UTC

[1/2] mesos git commit: Added flag in logrotate module to control number of libprocess threads.

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 <jo...@gmail.com>
Authored: Wed Aug 3 18:21:09 2016 -0400
Committer: Joris Van Remoortere <jo...@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;
 };
 
 


[2/2] mesos git commit: Updated logrotation module to use `os::pagesize()`.

Posted by jo...@apache.org.
Updated logrotation module to use `os::pagesize()`.

This gets us closer to compiling on Windows.

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


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

Branch: refs/heads/master
Commit: f538c4bc2b5786875c3eca776234e554dcfb08d6
Parents: df1e231
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Wed Aug 3 18:21:19 2016 -0400
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Aug 3 18:22:21 2016 -0400

----------------------------------------------------------------------
 src/slave/container_loggers/lib_logrotate.hpp | 5 +++--
 src/slave/container_loggers/logrotate.cpp     | 3 ++-
 src/slave/container_loggers/logrotate.hpp     | 6 ++++--
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f538c4bc/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 193b3ff..6fe38d1 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -26,6 +26,7 @@
 #include <stout/option.hpp>
 
 #include <stout/os/exists.hpp>
+#include <stout/os/pagesize.hpp>
 #include <stout/os/shell.hpp>
 
 #include "slave/container_loggers/logrotate.hpp"
@@ -131,10 +132,10 @@ struct Flags : public virtual flags::FlagsBase
 
   static Option<Error> validateSize(const Bytes& value)
   {
-    if (value.bytes() < (size_t) sysconf(_SC_PAGE_SIZE)) {
+    if (value.bytes() < os::pagesize()) {
       return Error(
           "Expected --max_stdout_size and --max_stderr_size of "
-          "at least " + stringify(sysconf(_SC_PAGE_SIZE)) + " bytes");
+          "at least " + stringify(os::pagesize()) + " bytes");
     }
 
     return None();

http://git-wip-us.apache.org/repos/asf/mesos/blob/f538c4bc/src/slave/container_loggers/logrotate.cpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.cpp b/src/slave/container_loggers/logrotate.cpp
index a96cbf1..431bc3c 100644
--- a/src/slave/container_loggers/logrotate.cpp
+++ b/src/slave/container_loggers/logrotate.cpp
@@ -35,6 +35,7 @@
 #include <stout/stringify.hpp>
 #include <stout/try.hpp>
 
+#include <stout/os/pagesize.hpp>
 #include <stout/os/shell.hpp>
 #include <stout/os/write.hpp>
 
@@ -55,7 +56,7 @@ public:
       bytesWritten(0)
   {
     // Prepare a buffer for reading from the `incoming` pipe.
-    length = sysconf(_SC_PAGE_SIZE);
+    length = os::pagesize();
     buffer = new char[length];
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f538c4bc/src/slave/container_loggers/logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/logrotate.hpp b/src/slave/container_loggers/logrotate.hpp
index 16d9232..f906a16 100644
--- a/src/slave/container_loggers/logrotate.hpp
+++ b/src/slave/container_loggers/logrotate.hpp
@@ -26,6 +26,8 @@
 #include <stout/option.hpp>
 #include <stout/path.hpp>
 
+#include <stout/os/pagesize.hpp>
+
 
 namespace mesos {
 namespace internal {
@@ -55,10 +57,10 @@ struct Flags : public virtual flags::FlagsBase
         "Defaults to 10 MB.  Must be at least 1 (memory) page.",
         Megabytes(10),
         [](const Bytes& value) -> Option<Error> {
-          if (value.bytes() < (size_t) sysconf(_SC_PAGE_SIZE)) {
+          if (value.bytes() < os::pagesize()) {
             return Error(
                 "Expected --max_size of at least " +
-                stringify(sysconf(_SC_PAGE_SIZE)) + " bytes");
+                stringify(os::pagesize()) + " bytes");
           }
           return None();
         });