diff options
author | Denny <dennybritz@gmail.com> | 2012-10-13 13:44:24 -0700 |
---|---|---|
committer | Denny <dennybritz@gmail.com> | 2012-10-13 13:44:24 -0700 |
commit | 21047d923e4364023c556250c9f1cfbab6cc68ff (patch) | |
tree | 71f86e206840c5828ec45510e12fc494b49ccc72 /core | |
parent | fa41d50f7d666bee015c06d7d4113f6ccac20c30 (diff) | |
download | spark-21047d923e4364023c556250c9f1cfbab6cc68ff.tar.gz spark-21047d923e4364023c556250c9f1cfbab6cc68ff.tar.bz2 spark-21047d923e4364023c556250c9f1cfbab6cc68ff.zip |
Protect from setting null environment variables.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala b/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala index 303cbbda00..637e763c9e 100644 --- a/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala +++ b/core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala @@ -116,7 +116,11 @@ private[spark] class ExecutorRunner( val builder = new ProcessBuilder(command: _*).directory(executorDir) val env = builder.environment() for ((key, value) <- jobDesc.command.environment) { - env.put(key, value) + if (value == null) { + logInfo("Environment variable not set: " + key) + } else { + env.put(key, value) + } } // In case we are running this from within the Spark Shell // so we are not creating a parent process. |