Skip to content

Commit

Permalink
Put blacklisted env vars in a set
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmolek committed Nov 6, 2018
1 parent 2a1f312 commit 6ac6d7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ private[spark] class RestSubmissionClient(master: String) extends Logging {
}

private[spark] object RestSubmissionClient {
private val BLACKLISTED_SPARK_ENV_VARS = Set("SPARK_ENV_LOADED", "SPARK_HOME", "SPARK_CONF_DIR")
private val REPORT_DRIVER_STATUS_INTERVAL = 1000
private val REPORT_DRIVER_STATUS_MAX_TRIES = 10
val PROTOCOL_VERSION = "v1"
Expand All @@ -419,8 +420,7 @@ private[spark] object RestSubmissionClient {
env.filterKeys { k =>
// SPARK_HOME and SPARK_CONF_DIR are filtered out because they are usually wrong
// on the remote machine (SPARK-12345) (SPARK-25934)
(k.startsWith("SPARK_") && k != "SPARK_ENV_LOADED" && k != "SPARK_HOME"
&& k != "SPARK_CONF_DIR") || k.startsWith("MESOS_")
(k.startsWith("SPARK_") && !BLACKLISTED_SPARK_ENV_VARS.contains(k)) || k.startsWith("MESOS_")
}
}
}
Expand Down

0 comments on commit 6ac6d7d

Please sign in to comment.