Skip to content
Snippets Groups Projects
Commit 947b8bd8 authored by lianhuiwang's avatar lianhuiwang Committed by Andrew Or
Browse files

[SPARK-5759][Yarn]ExecutorRunnable should catch YarnException while NMClient start contain...

some time since some reasons, it lead to some exception while NMClient start some containers.example:we do not config spark_shuffle on some machines, so it will throw a exception:
java.lang.Error: org.apache.hadoop.yarn.exceptions.InvalidAuxServiceException: The auxService:spark_shuffle does not exist.
because YarnAllocator use ThreadPoolExecutor to start Container, so we can not find which container or hostname throw exception. I think we should catch YarnException in ExecutorRunnable when start container. if there are some exceptions, we can know the container id or hostname of failed container.

Author: lianhuiwang <lianhuiwang09@gmail.com>

Closes #4554 from lianhuiwang/SPARK-5759 and squashes the following commits:

caf5a99 [lianhuiwang] use SparkException to warp exception
c02140f [lianhuiwang] ExecutorRunnable should catch YarnException while NMClient start container
parent 1d5663e9
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.ipc.YarnRPC
import org.apache.hadoop.yarn.util.{ConverterUtils, Records}
import org.apache.spark.{SecurityManager, SparkConf, Logging}
import org.apache.spark.{Logging, SecurityManager, SparkConf, SparkException}
import org.apache.spark.network.util.JavaUtils
class ExecutorRunnable(
......@@ -109,7 +109,13 @@ class ExecutorRunnable(
}
// Send the start request to the ContainerManager
nmClient.startContainer(container, ctx)
try {
nmClient.startContainer(container, ctx)
} catch {
case ex: Exception =>
throw new SparkException(s"Exception while starting container ${container.getId}" +
s" on host $hostname", ex)
}
}
private def prepareCommand(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment