You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/10/15 00:12:19 UTC
[1/2] mesos git commit: Added note to CHANGELOG about --runtime_dir.
Repository: mesos
Updated Branches:
refs/heads/master 6a47d0da2 -> 4b2033b2c
Added note to CHANGELOG about --runtime_dir.
Review: https://reviews.apache.org/r/52814/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4b2033b2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4b2033b2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4b2033b2
Branch: refs/heads/master
Commit: 4b2033b2c5c629ccfcb276f66e63ebc8e5981a9d
Parents: df1b91f
Author: Kevin Klues <kl...@gmail.com>
Authored: Fri Oct 14 17:10:18 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Oct 14 17:12:07 2016 -0700
----------------------------------------------------------------------
CHANGELOG | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4b2033b2/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 7ffd223..fdb8873 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -41,6 +41,12 @@ Deprecations:
* [MESOS-6371] - Remove the 'recover()' interface in 'ContainerLogger'.
Additional API Changes:
+ * [MESOS-6204] - A new agent flag called `--runtime_dir`. Unlike
+ `--work_dir` which persists data across reboots, `--runtime_dir` is designed
+ to checkpoint state that should persist across agent restarts, but not
+ across reboots. By default this flag is set to `/var/run/mesos` when run as
+ root and `os::temp/mesos/runtime/` when run as non-root.
+
* [MESOS-6220] - HTTP handler failures should result in 500 rather than
503 responses. This means that when using the master or agent endpoints,
failures will now result in a `500 Internal Server Error` rather than a
[2/2] mesos git commit: Updated default value of the '--runtime_dir'
agent flag.
Posted by vi...@apache.org.
Updated default value of the '--runtime_dir' agent flag.
Previously, the default value of '--runtime_dir' was hard coded to
'/var/run/mesos'. However, this directory is typically only accessable
to the 'root' user. This caused problems when launching an agent as a
non-root user. We now check to see if the agent is launched as root or
not, and change this default accordingly.
Review: https://reviews.apache.org/r/52902/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/df1b91f6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/df1b91f6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/df1b91f6
Branch: refs/heads/master
Commit: df1b91f6f0012f671f908b35a047830898f41803
Parents: 6a47d0d
Author: Kevin Klues <kl...@gmail.com>
Authored: Fri Oct 14 17:10:14 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Oct 14 17:12:07 2016 -0700
----------------------------------------------------------------------
src/slave/constants.hpp | 2 +-
src/slave/flags.cpp | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/df1b91f6/src/slave/constants.hpp
----------------------------------------------------------------------
diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
index 0640721..6c381f0 100644
--- a/src/slave/constants.hpp
+++ b/src/slave/constants.hpp
@@ -141,7 +141,7 @@ Duration DEFAULT_MASTER_PING_TIMEOUT();
// Default path of the agent runtime directory. This is where runtime
// data is stored by an agent that it needs to persist across crashes
// (but not across reboots). This directory will be cleared on reboot.
-constexpr char DEFAULT_RUNTIME_DIRECTORY[] = "/var/run/mesos";
+constexpr char DEFAULT_ROOT_RUNTIME_DIRECTORY[] = "/var/run/mesos";
// Name of the executable for default executor.
constexpr char MESOS_DEFAULT_EXECUTOR[] = "mesos-default-executor";
http://git-wip-us.apache.org/repos/asf/mesos/blob/df1b91f6/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 08f534f..87d9e46 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -208,7 +208,16 @@ mesos::internal::slave::Flags::Flags()
"is stored by an agent that it needs to persist across crashes (but\n"
"not across reboots). This directory will be cleared on reboot.\n"
"(Example: `/var/run/mesos`)",
- DEFAULT_RUNTIME_DIRECTORY);
+ []() -> string {
+ Result<string> user = os::user();
+ CHECK_SOME(user);
+
+ if (user.get() == "root") {
+ return DEFAULT_ROOT_RUNTIME_DIRECTORY;
+ } else {
+ return path::join(os::temp(), "mesos", "runtime");
+ }
+ }());
add(&Flags::launcher_dir, // TODO(benh): This needs a better name.
"launcher_dir",