Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/8093#discussion_r42915834 --- Diff: core/src/main/scala/org/apache/spark/TaskEndReason.scala --- @@ -217,11 +217,14 @@ case class TaskCommitDenied( * the task crashed the JVM. */ @DeveloperApi -case class ExecutorLostFailure(execId: String, isNormalExit: Boolean = false) - extends TaskFailedReason { +case class ExecutorLostFailure(execId: String, isNormalExit: Boolean = false, reason: +Option[String]) extends TaskFailedReason { override def toErrorString: String = { val exitBehavior = if (isNormalExit) "normally" else "abnormally" - s"ExecutorLostFailure (executor ${execId} exited ${exitBehavior})" + s"ExecutorLostFailure (executor ${execId} exited ${exitBehavior})" + + reason.fold(""){ --- End diff -- We don't usually use `fold`, we prefer `map` instead: reason.map { r => s" Reason: $r" }.getOrElse("")
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org