Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.executor

import org.apache.spark.{TaskCommitDenied, TaskFailedReason}
import org.apache.spark.TaskCommitDenied

/**
* Exception thrown when a task attempts to commit output to HDFS but is denied by the driver.
Expand All @@ -29,5 +29,5 @@ private[spark] class CommitDeniedException(
attemptNumber: Int)
extends Exception(msg) {

def toTaskFailedReason: TaskFailedReason = TaskCommitDenied(jobID, splitID, attemptNumber)
def toTaskCommitDeniedReason: TaskCommitDenied = TaskCommitDenied(jobID, splitID, attemptNumber)
}
4 changes: 2 additions & 2 deletions core/src/main/scala/org/apache/spark/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ private[spark] class Executor(
taskId, TaskState.KILLED, ser.serialize(TaskKilled(killReason)))

case CausedBy(cDE: CommitDeniedException) =>
val reason = cDE.toTaskFailedReason
val reason = cDE.toTaskCommitDeniedReason
setTaskFinishedAndClearInterruptStatus()
execBackend.statusUpdate(taskId, TaskState.FAILED, ser.serialize(reason))
execBackend.statusUpdate(taskId, TaskState.KILLED, ser.serialize(reason))

case t: Throwable =>
// Attempt to exit cleanly by informing the driver of our failure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging {
case kill: TaskKilled =>
execSummary.reasonToNumKilled = execSummary.reasonToNumKilled.updated(
kill.reason, execSummary.reasonToNumKilled.getOrElse(kill.reason, 0) + 1)
case commitDenied: TaskCommitDenied =>
execSummary.reasonToNumKilled = execSummary.reasonToNumKilled.updated(
commitDenied.toErrorString, execSummary.reasonToNumKilled.getOrElse(
commitDenied.toErrorString, 0) + 1)
case _ =>
execSummary.failedTasks += 1
}
Expand All @@ -390,6 +394,11 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging {
stageData.reasonToNumKilled = stageData.reasonToNumKilled.updated(
kill.reason, stageData.reasonToNumKilled.getOrElse(kill.reason, 0) + 1)
Some(kill.toErrorString)
case commitDenied: TaskCommitDenied =>
stageData.reasonToNumKilled = stageData.reasonToNumKilled.updated(
commitDenied.toErrorString, stageData.reasonToNumKilled.getOrElse(
commitDenied.toErrorString, 0) + 1)
Some(commitDenied.toErrorString)
case e: ExceptionFailure => // Handle ExceptionFailure because we might have accumUpdates
stageData.numFailedTasks += 1
Some(e.toErrorString)
Expand Down Expand Up @@ -428,6 +437,10 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging {
case kill: TaskKilled =>
jobData.reasonToNumKilled = jobData.reasonToNumKilled.updated(
kill.reason, jobData.reasonToNumKilled.getOrElse(kill.reason, 0) + 1)
case commitDenied: TaskCommitDenied =>
jobData.reasonToNumKilled = jobData.reasonToNumKilled.updated(
commitDenied.toErrorString, jobData.reasonToNumKilled.getOrElse(
commitDenied.toErrorString, 0) + 1)
case _ =>
jobData.numFailedTasks += 1
}
Expand Down