[GitHub] spark pull request #20781: [SPARK-23637][YARN]Yarn might allocate more resou...

2018-04-04 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/20781


---

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



[GitHub] spark pull request #20781: [SPARK-23637][YARN]Yarn might allocate more resou...

2018-03-12 Thread jerryshao
Github user jerryshao commented on a diff in the pull request:

https://github.com/apache/spark/pull/20781#discussion_r173709533
  
--- Diff: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala
 ---
@@ -81,7 +81,7 @@ private[yarn] class YarnAllocator(
   private val releasedContainers = Collections.newSetFromMap[ContainerId](
 new ConcurrentHashMap[ContainerId, java.lang.Boolean])
 
-  private val numExecutorsRunning = new AtomicInteger(0)
+  private val runningExecutors = new 
java.util.concurrent.ConcurrentHashMap[String, Unit]()
--- End diff --

This can be changed to `Collections.newSetFromMap`, since we only need 
`Set` instead of `Map`.


---

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



[GitHub] spark pull request #20781: [SPARK-23637][YARN]Yarn might allocate more resou...

2018-03-08 Thread jinxing64
GitHub user jinxing64 opened a pull request:

https://github.com/apache/spark/pull/20781

[SPARK-23637][YARN]Yarn might allocate more resource if a same executor is 
killed multiple times.

## What changes were proposed in this pull request?
`YarnAllocator` uses `numExecutorsRunning` to track the number of running 
executor. `numExecutorsRunning` is used to check if there're executors missing 
and need to allocate more.

 In current code, `numExecutorsRunning` can be negative when driver asks to 
kill a same idle executor multiple times.


## How was this patch tested?
UT added

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jinxing64/spark SPARK-23637

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/20781.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #20781


commit bd6f8a1dd608d95f6faf2758cbd36e6328f48eb3
Author: jinxing 
Date:   2018-03-09T05:53:10Z

[SPARK-23637][YARN]Yarn might allocate more resource if a same executor is 
killed multiple times.




---

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