MCPcopy Create free account
hub / github.com/apache/mesos / processCommandCheckResult

Method processCommandCheckResult

src/checks/checker_process.cpp:969–1003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967
968
969void CheckerProcess::processCommandCheckResult(
970 const Stopwatch& stopwatch,
971 const Future<int>& future)
972{
973 CHECK(!future.isPending());
974
975 Result<CheckStatusInfo> result = None();
976
977 // On Posix, `future` corresponds to termination information in the
978 // `stat_loc` area. On Windows, `status` is obtained via calling the
979 // `GetExitCodeProcess()` function.
980 //
981 // TODO(alexr): Ensure `WEXITSTATUS` family macros are no-op on Windows,
982 // see MESOS-7242.
983 if (future.isReady() && WIFEXITED(future.get())) {
984 const int exitCode = WEXITSTATUS(future.get());
985 LOG(INFO) << name << " for task '" << taskId << "' returned: " << exitCode;
986
987 CheckStatusInfo checkStatusInfo;
988 checkStatusInfo.set_type(CheckInfo::COMMAND);
989 checkStatusInfo.mutable_command()->set_exit_code(
990 static_cast<int32_t>(exitCode));
991
992 result = Result<CheckStatusInfo>(checkStatusInfo);
993 } else if (future.isDiscarded()) {
994 // Check's status is currently not available due to a transient error,
995 // e.g., due to the agent failover, no `CheckStatusInfo` message should
996 // be sent to the callback.
997 result = None();
998 } else {
999 result = Result<CheckStatusInfo>(Error(future.failure()));
1000 }
1001
1002 processCheckResult(stopwatch, result);
1003}
1004
1005static vector<string> httpCheckCommand(
1006 const string& command,

Callers

nothing calls this directly

Calls 7

NoneClass · 0.85
isReadyMethod · 0.80
isDiscardedMethod · 0.80
failureMethod · 0.80
ErrorFunction · 0.50
isPendingMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected