Skip to content

Commit c02140f

Browse files
committed
ExecutorRunnable should catch YarnException while NMClient start container
1 parent a38e23c commit c02140f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.apache.hadoop.yarn.api._
3535
import org.apache.hadoop.yarn.api.records._
3636
import org.apache.hadoop.yarn.client.api.NMClient
3737
import org.apache.hadoop.yarn.conf.YarnConfiguration
38+
import org.apache.hadoop.yarn.exceptions.YarnException
3839
import org.apache.hadoop.yarn.ipc.YarnRPC
3940
import org.apache.hadoop.yarn.util.{ConverterUtils, Records}
4041

@@ -109,7 +110,14 @@ class ExecutorRunnable(
109110
}
110111

111112
// Send the start request to the ContainerManager
112-
nmClient.startContainer(container, ctx)
113+
try {
114+
nmClient.startContainer(container, ctx)
115+
} catch {
116+
case ex: YarnException =>
117+
logError("Exception while start container %s on host %s:"
118+
.format(container.getId, hostname), ex)
119+
throw ex
120+
}
113121
}
114122

115123
private def prepareCommand(

0 commit comments

Comments
 (0)