You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/27 05:29:51 UTC

[GitHub] [spark] warrenzhu25 commented on a change in pull request #29082: [SPARK-32288][UI] Add exception summary for failed tasks in stage page

warrenzhu25 commented on a change in pull request #29082:
URL: https://github.com/apache/spark/pull/29082#discussion_r460654448



##########
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:
       This errorMessage is actually errorMessage with stacktrace. So it includes:
   1. First line contains exception type and error message
   2. Stacktrace started at `\t` and end with line break.
   I'll rewrite this to only include the first line, then split by ":"




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org