Skip to content

Commit 6ac6d7d

Browse files
committed
Put blacklisted env vars in a set
1 parent 2a1f312 commit 6ac6d7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ private[spark] class RestSubmissionClient(master: String) extends Logging {
408408
}
409409

410410
private[spark] object RestSubmissionClient {
411+
private val BLACKLISTED_SPARK_ENV_VARS = Set("SPARK_ENV_LOADED", "SPARK_HOME", "SPARK_CONF_DIR")
411412
private val REPORT_DRIVER_STATUS_INTERVAL = 1000
412413
private val REPORT_DRIVER_STATUS_MAX_TRIES = 10
413414
val PROTOCOL_VERSION = "v1"
@@ -419,8 +420,7 @@ private[spark] object RestSubmissionClient {
419420
env.filterKeys { k =>
420421
// SPARK_HOME and SPARK_CONF_DIR are filtered out because they are usually wrong
421422
// on the remote machine (SPARK-12345) (SPARK-25934)
422-
(k.startsWith("SPARK_") && k != "SPARK_ENV_LOADED" && k != "SPARK_HOME"
423-
&& k != "SPARK_CONF_DIR") || k.startsWith("MESOS_")
423+
(k.startsWith("SPARK_") && !BLACKLISTED_SPARK_ENV_VARS.contains(k)) || k.startsWith("MESOS_")
424424
}
425425
}
426426
}

0 commit comments

Comments
 (0)