XComp commented on a change in pull request #15049:
URL: https://github.com/apache/flink/pull/15049#discussion_r591579933
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandler.java
##########
@@ -132,7 +143,61 @@ private static JobExceptionsInfo createJobExceptionsInfo(
}
}
+ final ErrorInfo rootCause = executionGraph.getFailureInfo();
+ return new JobExceptionsInfoWithHistory(
+ rootCause.getException().getOriginalErrorClassName(),
+ rootCause.getExceptionAsString(),
+ rootCause.getTimestamp(),
+ taskExceptionList,
+ truncated,
+ createJobExceptionHistory(
+ executionGraphInfo.getExceptionHistory(),
exceptionToReportMaxSize));
+ }
+
+ static JobExceptionsInfoWithHistory.JobExceptionHistory
createJobExceptionHistory(
+ BoundedFIFOQueue<ExceptionHistoryEntry> historyEntries, int limit)
{
+ // we need to reverse the history to have a stable result when doing
paging on it
+ final List<ExceptionHistoryEntry> reversedHistoryEntries = new
ArrayList<>();
+ Iterables.addAll(reversedHistoryEntries, historyEntries);
+ Collections.reverse(reversedHistoryEntries);
+
+ List<JobExceptionsInfo> exceptionHistoryEntries =
+ reversedHistoryEntries.stream()
+ .limit(limit)
+ .map(JobExceptionsHandler::createJobExceptionInfo)
+ .collect(Collectors.toList());
+
+ return new JobExceptionsInfoWithHistory.JobExceptionHistory(
+ exceptionHistoryEntries,
+ historyEntries.getElementCount(),
Review comment:
My initial motivation was to make it more transparent that the
exceptions listed are just the most recent ones. Removing the `total` count
from the response object might make the user assume that these are the only
exceptions that were caught.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]