sarutak commented on a change in pull request #29082:
URL: https://github.com/apache/spark/pull/29082#discussion_r460619103
##########
File path: core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
##########
@@ -223,6 +223,22 @@ private[ui] class StagePage(parent: StagesTab, store:
AppStatusStore) extends We
null
}
+ val exceptionSummaryData = store.exceptionSummary(stageId, stageAttemptId)
+ val exceptionSummary: Seq[Node] =
+ {if (exceptionSummaryData.nonEmpty) {
+ <span class="collapse-aggregated-exceptionSummaries collapse-table"
+ onClick="collapseTable('collapse-aggregated-exceptionSummaries',
+ 'aggregated-exceptionSummaries')">
+ <h4>
+ <span class="collapse-table-arrow arrow-closed"></span>
+ <a>Exception Summary</a>
+ </h4>
+ </span>
+ <div class="aggregated-exceptionSummaries collapsible-table">
Review comment:
* nit: Indentation is wrong.
* The direction of the arrow should be downward when the summary is shown.
* I think it's better that the initial visibility state of the summary is
"close".
##########
File path: core/src/main/scala/org/apache/spark/status/AppStatusStore.scala
##########
@@ -421,6 +420,26 @@ private[spark] class AppStatusStore(
constructTaskDataList(taskDataWrapperIter)
}
+ def exceptionSummary(stageId: Int, attemptId: Int): Seq[v1.ExceptionSummary]
= {
+ val tasks = taskList(stageId, attemptId, Int.MaxValue)
+ tasks.filter(t => t.status.equalsIgnoreCase("failed"))
+ .flatMap(t => t.errorMessage)
Review comment:
If an exception doesn't have any error message, it can't appear in the
summary.
##########
File path: core/src/main/scala/org/apache/spark/status/AppStatusStore.scala
##########
@@ -421,6 +420,26 @@ private[spark] class AppStatusStore(
constructTaskDataList(taskDataWrapperIter)
}
+ def exceptionSummary(stageId: Int, attemptId: Int): Seq[v1.ExceptionSummary]
= {
+ val tasks = taskList(stageId, attemptId, Int.MaxValue)
+ tasks.filter(t => t.status.equalsIgnoreCase("failed"))
+ .flatMap(t => t.errorMessage)
+ .flatMap(parseErrorMessage)
+ .groupBy(e => (e.exceptionType, e.message))
+ .map(t => new v1.ExceptionSummary(t._2.head, t._2.length))
+ .toSeq
+ .sortBy(s => (s.count, s.exceptionFailure.exceptionType))(Ordering[(Int,
String)].reverse)
+ }
+
+ def parseErrorMessage(errorMessage: String): Option[v1.ExceptionFailure] = {
+ errorMessage.split("\\r?\\n")
+ .find(s => !s.startsWith("\t") && s.contains("Exception:"))
Review comment:
* Is it possible to have "\r" and "\t" in the message?
* This code assumes the class name contained in the message ends with
`Exception` so this can't cover `Error` e.g, OutOfMemoryError.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]