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/04/22 23:21:08 UTC
mesos git commit: Fixed slave to initialize libprocess before modules.
Repository: mesos
Updated Branches:
refs/heads/master bb52b44a3 -> 3836da707
Fixed slave to initialize libprocess before modules.
This is important because otherwise a module might call
libprocess `initialize()` before slave calls `initialize(id)`.
If this happens the HTTP request process "delegate" will be wrong.
Review: https://reviews.apache.org/r/46550/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3836da70
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3836da70
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3836da70
Branch: refs/heads/master
Commit: 3836da70715f4a7e4de6218fbbbafc900adae5af
Parents: bb52b44
Author: Andy Pang <pa...@huawei.com>
Authored: Fri Apr 22 14:20:45 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Apr 22 14:20:45 2016 -0700
----------------------------------------------------------------------
src/slave/main.cpp | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3836da70/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 38bd005..7d84c77 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -178,23 +178,6 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
- // Initialize modules. Note that since other subsystems may depend
- // upon modules, we should initialize modules before anything else.
- if (flags.modules.isSome()) {
- Try<Nothing> result = ModuleManager::load(flags.modules.get());
- if (result.isError()) {
- EXIT(EXIT_FAILURE) << "Error loading modules: " << result.error();
- }
- }
-
- // Initialize hooks.
- if (flags.hooks.isSome()) {
- Try<Nothing> result = HookManager::initialize(flags.hooks.get());
- if (result.isError()) {
- EXIT(EXIT_FAILURE) << "Error installing hooks: " << result.error();
- }
- }
-
// Initialize libprocess.
if (ip_discovery_command.isSome() && ip.isSome()) {
EXIT(EXIT_FAILURE) << flags.usage(
@@ -229,6 +212,23 @@ int main(int argc, char** argv)
logging::initialize(argv[0], flags, true); // Catch signals.
+ // Initialize modules. Note that since other subsystems may depend
+ // upon modules, we should initialize modules before anything else.
+ if (flags.modules.isSome()) {
+ Try<Nothing> result = ModuleManager::load(flags.modules.get());
+ if (result.isError()) {
+ EXIT(EXIT_FAILURE) << "Error loading modules: " << result.error();
+ }
+ }
+
+ // Initialize hooks.
+ if (flags.hooks.isSome()) {
+ Try<Nothing> result = HookManager::initialize(flags.hooks.get());
+ if (result.isError()) {
+ EXIT(EXIT_FAILURE) << "Error installing hooks: " << result.error();
+ }
+ }
+
spawn(new VersionProcess(), true);
LOG(INFO) << "Build: " << build::DATE << " by " << build::USER;