Github user ksakellis commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4051#discussion_r23571627
  
    --- Diff: 
yarn/src/main/scala/org/apache/spark/deploy/yarn/ClientArguments.scala ---
    @@ -75,14 +75,23 @@ private[spark] class ClientArguments(args: 
Array[String], sparkConf: SparkConf)
           .orElse(sparkConf.getOption("spark.yarn.dist.archives").map(p => 
Utils.resolveURIs(p)))
           .orElse(sys.env.get("SPARK_YARN_DIST_ARCHIVES"))
           .orNull
    -    // If dynamic allocation is enabled, start at the max number of 
executors
    +    // If dynamic allocation is enabled, start at the configured initial 
number of executors.
    +    // Default to minExecutors if no initialExecutors is set.
         if (isDynamicAllocationEnabled) {
    +      val minExecutorsConf = "spark.dynamicAllocation.minExecutors"
    +      val initialExecutorsConf = "spark.dynamicAllocation.initialExecutors"
           val maxExecutorsConf = "spark.dynamicAllocation.maxExecutors"
    -      if (!sparkConf.contains(maxExecutorsConf)) {
    +      val minNumExecutors = sparkConf.getInt(minExecutorsConf, 0)
    +      val initialNumExecutors = sparkConf.getInt(initialExecutorsConf, 
minNumExecutors)
    +      val maxNumExecutors = sparkConf.getInt(maxExecutorsConf, 
Integer.MAX_VALUE)
    +
    +      // If defined, initial executors must be between min and max
    +      if (initialNumExecutors < minNumExecutors || initialNumExecutors > 
maxNumExecutors) {
    --- End diff --
    
    Can you add this check in ExecutorAllocationManager where the other 
validations exist?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to