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 2015/10/16 23:30:39 UTC

mesos git commit: HTTP Scheduler should EXIT when MasterDetector creation fails.

Repository: mesos
Updated Branches:
  refs/heads/master 253abe798 -> 3c35a6b20


HTTP Scheduler should EXIT when MasterDetector creation fails.

The master detector is created during construction of the
`MesosProcess`.  If the flags cannot be loaded or if the
`MasterDetector::create` fails, the master detector will be null and
will result in a segfault if it is used during initialization.

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


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

Branch: refs/heads/master
Commit: 3c35a6b20dc07228ca30ad2d00115017224284a1
Parents: 253abe7
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Fri Oct 16 14:29:40 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Oct 16 14:29:41 2015 -0700

----------------------------------------------------------------------
 src/scheduler/scheduler.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3c35a6b2/src/scheduler/scheduler.cpp
----------------------------------------------------------------------
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index 56801ca..33e4d7c 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -130,8 +130,7 @@ public:
     Try<Nothing> load = flags.load("MESOS_");
 
     if (load.isError()) {
-      error("Failed to load flags: " + load.error());
-      return;
+      EXIT(1) << "Failed to load flags: " << load.error();
     }
 
     // Initialize libprocess (done here since at some point we might
@@ -167,8 +166,7 @@ public:
       MasterDetector::create(pid.isSome() ? string(pid.get()) : master);
 
     if (create.isError()) {
-      error("Failed to create a master detector:" + create.error());
-      return;
+      EXIT(1) << "Failed to create a master detector: " << create.error();
     }
 
     // Save the detector so we can delete it later.