@Override
public LivenessTestResult call() throws Exception {
Machine machine = this.livenessCheckTask.getMachine();
LivenessTestResult result = null;
try {
SshCommandResult commandResult = this.livenessCheckTask.call();
LivenessState state = (commandResult.getExitStatus() == 0) ? LivenessState.LIVE
: LivenessState.UNHEALTHY;
result = new LivenessTestResult(machine, state, commandResult);
} catch (Exception e) {
LOG.warn("liveness check failed: {}", e.getMessage());
result = new LivenessTestResult(machine,
LivenessState.UNHEALTHY, e);
}
updateStateAndAlertOnChange(result);
return result;
}