use of com.microsoft.frameworklauncher.common.service.StopStatus in project pai by Microsoft.
the class ApplicationMaster method stopForContainer.
private void stopForContainer(int exitCode, String diagnostics, String customizedDiagnostics) {
ExitStatusValue partialValue = new ExitStatusValue(exitCode, diagnostics, null);
String fullDiagnostics = ExitDiagnostics.generateDiagnostics(partialValue, customizedDiagnostics);
ExitStatusKey exitStatusKey = ExitDiagnostics.extractExitStatusKey(fullDiagnostics);
stop(new StopStatus(exitStatusKey.toInt(), true, fullDiagnostics));
}
use of com.microsoft.frameworklauncher.common.service.StopStatus in project pai by Microsoft.
the class Service method handleException.
@Override
protected Boolean handleException(Exception e) {
super.handleException(e);
if (e instanceof NonTransientException) {
LOGGER.logError(e, "NonTransientException occurred in %1$s. %1$s will be stopped.", serviceName);
stop(new StopStatus(ExitStatusKey.LAUNCHER_INTERNAL_NON_TRANSIENT_ERROR.toInt(), true, null, e));
return false;
} else {
LOGGER.logError(e, "Exception occurred in %1$s. It should be transient. Will restart %1$s inplace.", serviceName);
// TODO: Only Restart Service instead of exit whole process and Restart by external system.
stop(new StopStatus(ExitStatusKey.LAUNCHER_INTERNAL_UNKNOWN_ERROR.toInt(), false, null, e));
return true;
}
}
use of com.microsoft.frameworklauncher.common.service.StopStatus in project pai by Microsoft.
the class WebServer method handleException.
protected Boolean handleException(Exception e) {
super.handleException(e);
if (e instanceof NonTransientException) {
LOGGER.logError(e, "NonTransientException occurred in %1$s. %1$s will be stopped.", serviceName);
stop(new StopStatus(ExitStatusKey.LAUNCHER_INTERNAL_NON_TRANSIENT_ERROR.toInt(), true, null, e));
return false;
} else {
LOGGER.logError(e, "Exception occurred in %1$s. It should be transient. Will restart %1$s inplace.", serviceName);
// TODO: Only Restart WebServer instead of exit whole process and Restart by external system.
stop(new StopStatus(ExitStatusKey.LAUNCHER_INTERNAL_UNKNOWN_ERROR.toInt(), false, null, e));
return true;
}
}
use of com.microsoft.frameworklauncher.common.service.StopStatus in project pai by Microsoft.
the class ApplicationMaster method stopForInternalUnKnownError.
private void stopForInternalUnKnownError(String customizedDiagnostics) {
String diagnostics = ExitDiagnostics.generateDiagnostics(ExitStatusKey.AM_INTERNAL_UNKNOWN_ERROR, customizedDiagnostics);
stop(new StopStatus(ExitStatusKey.AM_INTERNAL_UNKNOWN_ERROR.toInt(), true, diagnostics));
}
use of com.microsoft.frameworklauncher.common.service.StopStatus in project pai by Microsoft.
the class ApplicationMaster method stopForInternalNonTransientError.
private void stopForInternalNonTransientError(String customizedDiagnostics) {
String diagnostics = ExitDiagnostics.generateDiagnostics(ExitStatusKey.AM_INTERNAL_NON_TRANSIENT_ERROR, customizedDiagnostics);
stop(new StopStatus(ExitStatusKey.AM_INTERNAL_NON_TRANSIENT_ERROR.toInt(), true, diagnostics));
}
Aggregations