Repository: mesos
Updated Branches:
  refs/heads/master b11f7aefe -> 5b42b52f5


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/5b42b52f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5b42b52f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5b42b52f

Branch: refs/heads/master
Commit: 5b42b52f5c932ad0d32f9718d544f75b604cb508
Parents: b11f7ae
Author: Xudong Ni <[email protected]>
Authored: Mon May 7 14:39:46 2018 -0700
Committer: Jiang Yan Xu <[email protected]>
Committed: Mon May 7 17:00:43 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/5b42b52f/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);
     }));

Reply via email to