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

    https://github.com/apache/spark/pull/8737#discussion_r40026765
  
    --- Diff: 
core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala ---
    @@ -233,6 +233,14 @@ private[spark] class ExecutorAllocationManager(
       }
     
       /**
    +   * Change the value of numExecutorsTarget.
    +   */
    +  def reSetNumExecutorsTarget(): Unit = {
    +   logDebug(s"Now reset the value of numExecutorsTarget.")
    +    numExecutorsTarget = 
conf.getInt("spark.dynamicAllocation.initialExecutors", minNumExecutors)
    --- End diff --
    
    If I understand correctly what's going on, this will result in 
`addExecutors` to issue a request for the desired number of executors, if that 
does not match `spark.dynamicAllocation.initialExecutors`, right? That same 
method will also bring `numExecutorsTarget` up to whatever was the previous 
value once it runs.
    
    Instead, wouldn't it be clearer to just explicitly send a message to the AM 
saying "this is the current state of the world, initialize yourself to deal 
with it"? Maybe as a reply to the `RegisterClusterManager` message.
    
    Also, `YarnAllocator` holds a lot of state about existing containers, such 
as in `allocatedHostToContainersMap` and `releasedContainers`. Is that data 
re-created somehow when the new AM comes up? If not, what are the side-effects, 
if any, of not having that information around?


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