MAPREDUCE-7191. JobHistoryServer should log exception when loading/parsing history file failed. Contributed by Jiandan Yang.

(cherry picked from commit f0605146b34ddbd19fc9e52d4761f9a347d5173e)
This commit is contained in:
Weiwei Yang 2019-03-11 15:02:54 +08:00
parent b0b8000240
commit fdd56b5b05

View File

@ -380,17 +380,20 @@ protected synchronized void loadFullHistoryData(boolean loadTasks,
parser = createJobHistoryParser(historyFileAbsolute);
this.jobInfo = parser.parse();
} catch (IOException e) {
throw new YarnRuntimeException("Could not load history file "
+ historyFileAbsolute, e);
String errorMsg = "Could not load history file " + historyFileAbsolute;
LOG.warn(errorMsg, e);
throw new YarnRuntimeException(errorMsg, e);
}
IOException parseException = parser.getParseException();
if (parseException != null) {
throw new YarnRuntimeException(
"Could not parse history file " + historyFileAbsolute,
parseException);
String errorMsg = "Could not parse history file " + historyFileAbsolute;
LOG.warn(errorMsg, parseException);
throw new YarnRuntimeException(errorMsg, parseException);
}
} else {
throw new IOException("History file not found");
String errorMsg = "History file not found";
LOG.warn(errorMsg);
throw new IOException(errorMsg);
}
if (loadTasks) {
loadAllTasks();