Skip to content

Conversation

@ArcherShao
Copy link
Contributor

In ExecutorAllocationManager, executor allocate schedule at a fix rate(100ms), it will call the method 'addOrCancelExecutorRequests' first, and then remove expired excutors.
Suppose at time T, no task is running or pending, and there a 5 executors runing, but all expired.

  1. the method 'addOrCancelExecutorRequests' wiill be called, and the value of 'ExecutorAllocationManager.numExecutorsPending' will update to -5.
  2. remove 5 expired excutors.
    Suppose still no task is running or pending at T+1, the method 'targetNumExecutors' will return -5, and method 'addExecutors' will be called,

private def addExecutors(maxNumExecutorsNeeded: Int): Int = {
val currentTarget = targetNumExecutors
....
val actualMaxNumExecutors = math.min(maxNumExecutors, maxNumExecutorsNeeded)
val newTotalExecutors = math.min(currentTarget + numExecutorsToAdd, actualMaxNumExecutors)
val addRequestAcknowledged = testing || client.requestTotalExecutors(newTotalExecutors)
....
}

newTotalExecutors will be a negative number, when client.requestTotalExecutors(newTotalExecutors) called, it will throw an exception.

Let method 'targetNumExecutors' return a value not less than minNumExecutors, then the newTotalExecutors will never be negative.

And targetNumExecutors not less than minNumExecutors is also make sense.

@SparkQA
Copy link

SparkQA commented Apr 24, 2015

Test build #30908 has finished for PR 5676 at commit 1693b54.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@sryza
Copy link
Contributor

sryza commented Apr 24, 2015

This looks like a duplicate of SPARK-6954 (PR #5536)

@ArcherShao
Copy link
Contributor Author

@sryza Should I close this PR?

@srowen
Copy link
Member

srowen commented Apr 24, 2015

@ArcherShao yes please, the JIRA was already marked as a duplicate. https://issues.apache.org/jira/browse/SPARK-6891. Do you mind closing this PR?

@ArcherShao ArcherShao closed this Apr 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants