Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ private[mesos] class MesosSubmitRequestServlet(
// cause spark-submit script to look for files in SPARK_HOME instead.
// We only need the ability to specify where to find spark-submit script
// which user can user spark.executor.home or spark.home configurations.
//
// Due to https://issues.scala-lang.org/browse/SI-6654, `filterKeys` returns an
// unserializable object, so we must call `.map(identity)` on the result.
val environmentVariables = request.environmentVariables.filterKeys(!_.equals("SPARK_HOME"))
.map(identity)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there's a slightly nicer way...

// Do not use `filterKeys` here to avoid SI-6654, which breaks ZK persistence
val environmentVariables = request.environmentVariables.filter { case (k, _) =>
  k != "SPARK_HOME"
}

so we don't have to do the weird filterKeys(...).map(identity) thing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's better. Fixed.

val name = request.sparkProperties.get("spark.app.name").getOrElse(mainClass)

// Construct driver description
Expand Down