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

    https://github.com/apache/spark/pull/7657#discussion_r36581032
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2286,6 +2286,17 @@ private[spark] object Utils extends Logging {
         isInDirectory(parent, child.getParentFile)
       }
     
    +  /**
    +   * Return whether dynamic allocation is enabled in the given conf
    +   * Dynamic allocation and explicitly setting the number of executors are 
inherently
    +   * incompatible. In environments where dynamic allocation is turned on 
by default,
    +   * the latter should override the former (SPARK-9092).
    +   */
    +  def isDynamicAllocationEnabled(conf: SparkConf): Boolean = {
    +    conf.contains("spark.dynamicAllocation.enabled") &&
    +      !conf.contains("spark.executor.instances")
    --- End diff --
    
    Actually, thinking about it, this should probably use the code you had 
originally (`&& conf.getInt("spark.executor.instances", 0) == 0`), otherwise 
someone can set `spark.executor.instances` in the default config file and then 
it gets really hard to enable dynamic allocation.
    
    With the `== 0` check, if someone does that, they can still enable dynamic 
allocation by using `--conf spark.dynamicAllocation.enabled=true --conf 
spark.executor.instances=0` - which maybe is not optimal, but is the best we 
can do without adding code to figure out from where options are being set.


---
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