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

    https://github.com/apache/spark/pull/9147#discussion_r42301236
  
    --- Diff: 
yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala ---
    @@ -62,10 +62,19 @@ private[spark] class ApplicationMaster(
         .asInstanceOf[YarnConfiguration]
       private val isClusterMode = args.userClass != null
     
    -  // Default to numExecutors * 2, with minimum of 3
    -  private val maxNumExecutorFailures = 
sparkConf.getInt("spark.yarn.max.executor.failures",
    -    sparkConf.getInt("spark.yarn.max.worker.failures",
    -      math.max(sparkConf.getInt("spark.executor.instances", 0) *  2, 3)))
    +  // Default to twice the number of executors (twice the maximum number of 
executors if dynamic
    +  // allocation is enabled), with a minimum of 3.
    +  val defaultKey =
    +    if (Utils.isDynamicAllocationEnabled(sparkConf)) {
    +      "spark.dynamicAllocation.maxExecutors"
    +    } else {
    +      "spark.executor.instances"
    +    }
    +  val effectiveNumExecutors = sparkConf.getInt(defaultKey, 0)
    +  val defaultMaxNumExecutorFailures = math.max(3, 2 * 
effectiveNumExecutors)
    --- End diff --
    
    you addressed my comment quickly, but these should not be public or outside 
the scope of `maxNumExecutorFailures`. What I meant is more like:
    ```
    // Default to twice ...
    private val maxNumExecutorFailures: Int = {
      val defaultKey = ...
      sparkConf.getInt(...)
    }
    ```


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to