aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
authorKay Ousterhout <kayousterhout@gmail.com>2015-10-27 16:55:10 -0700
committerKay Ousterhout <kayousterhout@gmail.com>2015-10-27 16:55:10 -0700
commitb960a890561eaf3795b93c621bd95be81e56f5b7 (patch)
tree349ce1e83ccbf44341caf80f61673f34b1f53d33 /yarn
parent9fbd75ab5d46612e52116ec5b9ced70715cf26b5 (diff)
downloadspark-b960a890561eaf3795b93c621bd95be81e56f5b7.tar.gz
spark-b960a890561eaf3795b93c621bd95be81e56f5b7.tar.bz2
spark-b960a890561eaf3795b93c621bd95be81e56f5b7.zip
[SPARK-11178] Improving naming around task failures.
Commit af3bc59d1f5d9d952c2d7ad1af599c49f1dbdaf0 introduced new functionality so that if an executor dies for a reason that's not caused by one of the tasks running on the executor (e.g., due to pre-emption), Spark doesn't count the failure towards the maximum number of failures for the task. That commit introduced some vague naming that this commit attempts to fix; in particular: (1) The variable "isNormalExit", which was used to refer to cases where the executor died for a reason unrelated to the tasks running on the machine, has been renamed (and reversed) to "exitCausedByApp". The problem with the existing name is that it's not clear (at least to me!) what it means for an exit to be "normal"; the new name is intended to make the purpose of this variable more clear. (2) The variable "shouldEventuallyFailJob" has been renamed to "countTowardsTaskFailures". This variable is used to determine whether a task's failure should be counted towards the maximum number of failures allowed for a task before the associated Stage is aborted. The problem with the existing name is that it can be confused with implying that the task's failure should immediately cause the stage to fail because it is somehow fatal (this is the case for a fetch failure, for example: if a task fails because of a fetch failure, there's no point in retrying, and the whole stage should be failed). Author: Kay Ousterhout <kayousterhout@gmail.com> Closes #9164 from kayousterhout/SPARK-11178.
Diffstat (limited to 'yarn')
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala27
1 files changed, 14 insertions, 13 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala
index 1deaa3743d..875bbd4e4e 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala
@@ -445,40 +445,41 @@ private[yarn] class YarnAllocator(
// there are some exit status' we shouldn't necessarily count against us, but for
// now I think its ok as none of the containers are expected to exit.
val exitStatus = completedContainer.getExitStatus
- val (isNormalExit, containerExitReason) = exitStatus match {
+ val (exitCausedByApp, containerExitReason) = exitStatus match {
case ContainerExitStatus.SUCCESS =>
- (true, s"Executor for container $containerId exited normally.")
+ (false, s"Executor for container $containerId exited because of a YARN event (e.g., " +
+ "pre-emption) and not because of an error in the running job.")
case ContainerExitStatus.PREEMPTED =>
- // Preemption should count as a normal exit, since YARN preempts containers merely
- // to do resource sharing, and tasks that fail due to preempted executors could
+ // Preemption is not the fault of the running tasks, since YARN preempts containers
+ // merely to do resource sharing, and tasks that fail due to preempted executors could
// just as easily finish on any other executor. See SPARK-8167.
- (true, s"Container ${containerId}${onHostStr} was preempted.")
+ (false, s"Container ${containerId}${onHostStr} was preempted.")
// Should probably still count memory exceeded exit codes towards task failures
case VMEM_EXCEEDED_EXIT_CODE =>
- (false, memLimitExceededLogMessage(
+ (true, memLimitExceededLogMessage(
completedContainer.getDiagnostics,
VMEM_EXCEEDED_PATTERN))
case PMEM_EXCEEDED_EXIT_CODE =>
- (false, memLimitExceededLogMessage(
+ (true, memLimitExceededLogMessage(
completedContainer.getDiagnostics,
PMEM_EXCEEDED_PATTERN))
case unknown =>
numExecutorsFailed += 1
- (false, "Container marked as failed: " + containerId + onHostStr +
+ (true, "Container marked as failed: " + containerId + onHostStr +
". Exit status: " + completedContainer.getExitStatus +
". Diagnostics: " + completedContainer.getDiagnostics)
}
- if (isNormalExit) {
- logInfo(containerExitReason)
- } else {
+ if (exitCausedByApp) {
logWarning(containerExitReason)
+ } else {
+ logInfo(containerExitReason)
}
- ExecutorExited(0, isNormalExit, containerExitReason)
+ ExecutorExited(0, exitCausedByApp, containerExitReason)
} else {
// If we have already released this container, then it must mean
// that the driver has explicitly requested it to be killed
- ExecutorExited(completedContainer.getExitStatus, isNormalExit = true,
+ ExecutorExited(completedContainer.getExitStatus, exitCausedByApp = false,
s"Container $containerId exited from explicit termination request.")
}