Repository: mesos Updated Branches: refs/heads/master 6bf85dcfd -> 8ff66b1c2
Fixed error reporting when recovering log storage fails. `CHECK` macros are not appropriate for user-facing error messages. Review: https://reviews.apache.org/r/41270 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ddc88e88 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ddc88e88 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ddc88e88 Branch: refs/heads/master Commit: ddc88e8868f434d48e8a2926393d099a101c8c44 Parents: 6bf85dc Author: Neil Conway <[email protected]> Authored: Fri Dec 11 12:13:25 2015 -0800 Committer: Jie Yu <[email protected]> Committed: Fri Dec 11 12:13:25 2015 -0800 ---------------------------------------------------------------------- src/log/replica.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ddc88e88/src/log/replica.cpp ---------------------------------------------------------------------- diff --git a/src/log/replica.cpp b/src/log/replica.cpp index 233da16..45b7717 100644 --- a/src/log/replica.cpp +++ b/src/log/replica.cpp @@ -25,6 +25,7 @@ #include <stout/check.hpp> #include <stout/error.hpp> +#include <stout/exit.hpp> #include <stout/foreach.hpp> #include <stout/none.hpp> #include <stout/nothing.hpp> @@ -196,8 +197,6 @@ Result<Action> ReplicaProcess::read(uint64_t position) return Error(action.error()); } - CHECK_SOME(action); - return action.get(); } @@ -755,7 +754,9 @@ void ReplicaProcess::restore(const string& path) { Try<Storage::State> state = storage->restore(path); - CHECK_SOME(state) << "Failed to recover the log"; + if (state.isError()) { + EXIT(EXIT_FAILURE) << "Failed to recover the log: " << state.error(); + } // Pull out and save some of the state. metadata = state.get().metadata;
