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 <[email protected]> Authored: Mon May 7 14:39:46 2018 -0700 Committer: Jiang Yan Xu <[email protected]> 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); }));
