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/28 22:01:20 UTC

[2/3] mesos git commit: Added logic to ensure the during a HTTP to PID scheduler downgrade, the previous HTTP instance gets an error message.

Added logic to ensure the during a HTTP to PID scheduler downgrade, the
previous HTTP instance gets an error message.

Presently, when there is a downgrade from HTTP to PID based scheduler,
we did not use to send the previous HTTP scheduler instance an error
message. Modified the logic to send in an error message to the old HTTP
based instance.

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


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

Branch: refs/heads/master
Commit: 6d3db49bbec9fb84f350d009306bf83754f5a97f
Parents: 985b9d5
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Wed Oct 28 13:59:45 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Oct 28 13:59:47 2015 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6d3db49b/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 72ce331..9f4586e 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5465,16 +5465,16 @@ void Master::failoverFramework(Framework* framework, const UPID& newPid)
   const Option<UPID> oldPid = framework->pid;
 
   // There are a few failover cases to consider:
-  //   1. The pid has changed. In this case we definitely want to
-  //      send a FrameworkErrorMessage to shut down the older
-  //      scheduler.
+  //   1. The pid has changed or it was previously a HTTP based scheduler.
+  //      In these cases we definitely want to send a FrameworkErrorMessage to
+  //      shut down the older scheduler.
   //   2. The pid has not changed.
   //      2.1 The old scheduler on that pid failed over to a new
   //          instance on the same pid. No need to shut down the old
   //          scheduler as it is necessarily dead.
   //      2.2 This is a duplicate message. In this case, the scheduler
   //          has not failed over, so we do not want to shut it down.
-  if (oldPid.isSome() && oldPid != newPid) {
+  if (oldPid != newPid && framework->connected) {
     FrameworkErrorMessage message;
     message.set_message("Framework failed over");
     framework->send(message);