aboutsummaryrefslogtreecommitdiff
path: root/yarn/src
diff options
context:
space:
mode:
authorlianhuiwang <lianhuiwang09@gmail.com>2015-02-12 14:50:16 -0800
committerAndrew Or <andrew@databricks.com>2015-02-12 14:51:06 -0800
commit947b8bd82ec0f4c45910e6d781df4661f56e4587 (patch)
tree34544d81570ae5f3020937445b7c7535174f6bea /yarn/src
parent1d5663e92cdaaa3dabfa58fdd7aede7e4fa4ec63 (diff)
downloadspark-947b8bd82ec0f4c45910e6d781df4661f56e4587.tar.gz
spark-947b8bd82ec0f4c45910e6d781df4661f56e4587.tar.bz2
spark-947b8bd82ec0f4c45910e6d781df4661f56e4587.zip
[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
Diffstat (limited to 'yarn/src')
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala
index 6d5b8fda76..c1d3f7320f 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala
@@ -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(