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 02:35:48 UTC

mesos git commit: Fixed master to initialize libprocess before modules.

Repository: mesos
Updated Branches:
  refs/heads/master c426859d3 -> fa55a69a2


Fixed master to initialize libprocess before modules.

This is important because otherwise a module might call
libprocess `initialize()` before master calls `initialize("master")`.
If this happens the  HTTP request process "delegate" will be wrong,

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


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

Branch: refs/heads/master
Commit: fa55a69a2083c85176637fe40072b90d581499a9
Parents: c426859
Author: Andy Pang <pa...@huawei.com>
Authored: Thu Apr 21 17:32:04 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Thu Apr 21 17:32:15 2016 -0700

----------------------------------------------------------------------
 src/master/main.cpp | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fa55a69a/src/master/main.cpp
----------------------------------------------------------------------
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 7bbc982..e1b6d48 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -198,23 +198,6 @@ int main(int argc, char** argv)
     return EXIT_SUCCESS;
   }
 
-  // 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();
-    }
-  }
-
   if (ip_discovery_command.isSome() && ip.isSome()) {
     EXIT(EXIT_FAILURE) << flags.usage(
         "Only one of `--ip` or `--ip_discovery_command` should be specified");
@@ -262,6 +245,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;