diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2015-12-16 19:47:49 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-12-16 19:47:49 -0800 |
commit | d1508dd9b765489913bc948575a69ebab82f217b (patch) | |
tree | bc1452b2102b007e7c6dc760abd286f9361693fa /core | |
parent | fdb38227564c1af40cbfb97df420b23eb04c002b (diff) | |
download | spark-d1508dd9b765489913bc948575a69ebab82f217b.tar.gz spark-d1508dd9b765489913bc948575a69ebab82f217b.tar.bz2 spark-d1508dd9b765489913bc948575a69ebab82f217b.zip |
[SPARK-12386][CORE] Fix NPE when spark.executor.port is set.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #10339 from vanzin/SPARK-12386.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/SparkEnv.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/SparkEnv.scala b/core/src/main/scala/org/apache/spark/SparkEnv.scala index 84230e32a4..52acde1b41 100644 --- a/core/src/main/scala/org/apache/spark/SparkEnv.scala +++ b/core/src/main/scala/org/apache/spark/SparkEnv.scala @@ -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", |