[SPARK-12386][CORE] Fix NPE when spark.executor.port is set.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #10339 from vanzin/SPARK-12386.
This commit is contained in:
Marcelo Vanzin 2015-12-16 19:47:49 -08:00 committed by Andrew Or
parent fdb3822756
commit d1508dd9b7

View file

@ -256,7 +256,12 @@ object SparkEnv extends Logging {
if (rpcEnv.isInstanceOf[AkkaRpcEnv]) {
rpcEnv.asInstanceOf[AkkaRpcEnv].actorSystem
} else {
val actorSystemPort = if (port == 0) 0 else rpcEnv.address.port + 1
val actorSystemPort =
if (port == 0 || rpcEnv.address == null) {
port
} else {
rpcEnv.address.port + 1
}
// Create a ActorSystem for legacy codes
AkkaUtils.createActorSystem(
actorSystemName + "ActorSystem",