Skip to content

Commit

Permalink
fix Executor exit cause by ScriptTransformationWriterThread throw Tas…
Browse files Browse the repository at this point in the history
…kKilledException
  • Loading branch information
LuciferYang committed Aug 16, 2018
1 parent 5b4a38d commit 412497f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.hadoop.hive.serde2.AbstractSerDe
import org.apache.hadoop.hive.serde2.objectinspector._
import org.apache.hadoop.io.Writable

import org.apache.spark.{SparkException, TaskContext}
import org.apache.spark.{SparkException, TaskContext, TaskKilledException}
import org.apache.spark.internal.Logging
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
Expand Down Expand Up @@ -308,6 +308,12 @@ private class ScriptTransformationWriterThread(
}
threwException = false
} catch {
// TaskKilledException should not be thrown again, otherwise it will be captured by
// SparkUncaughtExceptionHandler, then Executor will exit because of TaskKilledException.
case e: TaskKilledException =>
_exception = e
proc.destroy()
logWarning(s"thread ${Thread.currentThread().getName} exit cause by ", e)
case t: Throwable =>
// An error occurred while writing input, so kill the child process. According to the
// Javadoc this call will not throw an exception:
Expand Down

0 comments on commit 412497f

Please sign in to comment.