You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2018/05/08 00:14:24 UTC

[1/2] mesos git commit: Failure to update registry should abort the master process.

Repository: mesos
Updated Branches:
  refs/heads/1.6.x 3e7041803 -> 3eb52bf49


Failure to update registry should abort the master process.

When the registrar fails to update the registry it would abort the
actor and fail all future operations. However when the registrar
update is requested by an operator API such as a maintenance update,
the master process doesn't shut down (a 500 error is returned to the
client instead) and all subsequent operations will fail.

This patch fixes the specific maintenance API case but we can follow
up with other call sites or put a fix in for the registrar itself.

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


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

Branch: refs/heads/1.6.x
Commit: 47ff5eccba5308d69ad31a8b8c704e2c8bde2087
Parents: 3e70418
Author: Xudong Ni <xu...@apple.com>
Authored: Mon May 7 14:39:46 2018 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Mon May 7 17:12:51 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/47ff5ecc/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 77cf47a..63fbd86 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -4300,6 +4300,14 @@ Future<Response> Master::Http::__updateMaintenanceSchedule(
 
   return master->registrar->apply(Owned<RegistryOperation>(
       new maintenance::UpdateSchedule(schedule)))
+    .onAny([](const Future<bool>& result){
+      // TODO(fiu): Consider changing/refactoring the registrar itself
+      // so the individual call sites don't need to handle this separately.
+      // All registrar failures that cause it to abort should instead
+      // abort the process.
+      CHECK_READY(result)
+        << "Failed to update maintenance schedule in the registry";
+    })
     .then(defer(master->self(), [this, schedule](bool result) {
       return ___updateMaintenanceSchedule(schedule, result);
     }));


[2/2] mesos git commit: Minor style fix.

Posted by ya...@apache.org.
Minor style fix.


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

Branch: refs/heads/1.6.x
Commit: 3eb52bf49f2ca8ecab06e8aab79f6931cb9bf8dd
Parents: 47ff5ec
Author: Jiang Yan Xu <xu...@apple.com>
Authored: Mon May 7 17:05:06 2018 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Mon May 7 17:12:52 2018 -0700

----------------------------------------------------------------------
 src/master/http.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3eb52bf4/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 63fbd86..0492b97 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -4300,7 +4300,7 @@ Future<Response> Master::Http::__updateMaintenanceSchedule(
 
   return master->registrar->apply(Owned<RegistryOperation>(
       new maintenance::UpdateSchedule(schedule)))
-    .onAny([](const Future<bool>& result){
+    .onAny([](const Future<bool>& result) {
       // TODO(fiu): Consider changing/refactoring the registrar itself
       // so the individual call sites don't need to handle this separately.
       // All registrar failures that cause it to abort should instead