aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/org/apache/spark/TaskEndReason.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/scala/org/apache/spark/TaskEndReason.scala')
-rw-r--r--core/src/main/scala/org/apache/spark/TaskEndReason.scala22
1 files changed, 16 insertions, 6 deletions
diff --git a/core/src/main/scala/org/apache/spark/TaskEndReason.scala b/core/src/main/scala/org/apache/spark/TaskEndReason.scala
index 9335c5f416..18278b292f 100644
--- a/core/src/main/scala/org/apache/spark/TaskEndReason.scala
+++ b/core/src/main/scala/org/apache/spark/TaskEndReason.scala
@@ -53,7 +53,13 @@ sealed trait TaskFailedReason extends TaskEndReason {
/** Error message displayed in the web UI. */
def toErrorString: String
- def shouldEventuallyFailJob: Boolean = true
+ /**
+ * Whether this task failure should be counted towards the maximum number of times the task is
+ * allowed to fail before the stage is aborted. Set to false in cases where the task's failure
+ * was unrelated to the task; for example, if the task failed because the executor it was running
+ * on was killed.
+ */
+ def countTowardsTaskFailures: Boolean = true
}
/**
@@ -208,7 +214,7 @@ case class TaskCommitDenied(
* towards failing the stage. This is intended to prevent spurious stage failures in cases
* where many speculative tasks are launched and denied to commit.
*/
- override def shouldEventuallyFailJob: Boolean = false
+ override def countTowardsTaskFailures: Boolean = false
}
/**
@@ -217,14 +223,18 @@ case class TaskCommitDenied(
* the task crashed the JVM.
*/
@DeveloperApi
-case class ExecutorLostFailure(execId: String, isNormalExit: Boolean = false)
+case class ExecutorLostFailure(execId: String, exitCausedByApp: Boolean = true)
extends TaskFailedReason {
override def toErrorString: String = {
- val exitBehavior = if (isNormalExit) "normally" else "abnormally"
- s"ExecutorLostFailure (executor ${execId} exited ${exitBehavior})"
+ val exitBehavior = if (exitCausedByApp) {
+ "caused by one of the running tasks"
+ } else {
+ "unrelated to the running tasks"
+ }
+ s"ExecutorLostFailure (executor ${execId} exited due to an issue ${exitBehavior})"
}
- override def shouldEventuallyFailJob: Boolean = !isNormalExit
+ override def countTowardsTaskFailures: Boolean = exitCausedByApp
}
/**