-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-9552] Add force control for killExecutors to avoid false killing for those busy executors #7888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
[SPARK-9552] Add force control for killExecutors to avoid false killing for those busy executors #7888
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c23f887
rebase to master branch
GraceH dc660f6
change the task number to count; change the WithLoads to WithTaskCount
GraceH 27faa6b
keep sparkcontext public API un-changed
GraceH 8774124
fix compile issue
GraceH 946ed7e
fix compile issue
GraceH feefbfe
keep public API
GraceH fa3c88e
keep public API
GraceH cb78e56
remove unnecessary comments
GraceH 5bcfd81
clean code
GraceH 01c236a
clean code
GraceH 2108dbf
refine code
GraceH c0a1d54
remove unnecessary imports
GraceH 4b1959f
set sc.killExecutor as force = true
GraceH 0293d82
use force = false to do the unittest
GraceH 342a59d
refine the unit test & change semantics for force == true only
GraceH 806a64d
refine the unit test & change semantics for force == true only
GraceH 4ce0ec0
remove unnecessary imports
GraceH 0000551
fix checkstyle issue
GraceH c44ef87
Suggestions
d3f51db
Clean up state in ExecutorAllocationManager
0daeb5a
Merge pull request #1 from andrewor14/pr-7888-suggestions
GraceH 1938e61
fix unittest issue
GraceH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
change the task number to count; change the WithLoads to WithTaskCount
- Loading branch information
commit dc660f63c416c300bd3da48c6a0b9442633313fc
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,8 +88,8 @@ private[spark] class TaskSchedulerImpl( | |
| val nextTaskId = new AtomicLong(0) | ||
|
|
||
| // Which executor IDs we have executors on | ||
| // each executor will record running or launched task number | ||
| val activeExecutorIdsWithLoads = new HashMap[String, Int] | ||
| // each executor will record running or launched task count | ||
| val activeExecutorIdsWithTaskCount = new HashMap[String, Int] | ||
|
|
||
| // The set of executors we have on each host; this is used to compute hostsAlive, which | ||
| // in turn is used to decide when we can attain data locality on a given host | ||
|
|
@@ -255,7 +255,7 @@ private[spark] class TaskSchedulerImpl( | |
| val tid = task.taskId | ||
| taskIdToTaskSetManager(tid) = taskSet | ||
| taskIdToExecutorId(tid) = execId | ||
| activeExecutorIdsWithLoads(execId) += 1 | ||
| activeExecutorIdsWithTaskCount(execId) += 1 | ||
| executorsByHost(host) += execId | ||
| availableCpus(i) -= CPUS_PER_TASK | ||
| assert(availableCpus(i) >= 0) | ||
|
|
@@ -284,7 +284,7 @@ private[spark] class TaskSchedulerImpl( | |
| var newExecAvail = false | ||
| for (o <- offers) { | ||
| executorIdToHost(o.executorId) = o.host | ||
| activeExecutorIdsWithLoads.getOrElseUpdate(o.executorId, 0) | ||
| activeExecutorIdsWithTaskCount.getOrElseUpdate(o.executorId, 0) | ||
| if (!executorsByHost.contains(o.host)) { | ||
| executorsByHost(o.host) = new HashSet[String]() | ||
| executorAdded(o.executorId, o.host) | ||
|
|
@@ -334,7 +334,7 @@ private[spark] class TaskSchedulerImpl( | |
| // We lost this entire executor, so remember that it's gone | ||
| val execId = taskIdToExecutorId(tid) | ||
|
|
||
| if (activeExecutorIdsWithLoads.contains(execId)) { | ||
| if (activeExecutorIdsWithTaskCount.contains(execId)) { | ||
| removeExecutor(execId, | ||
| SlaveLost(s"Task $tid was lost, so marking the executor as lost as well.")) | ||
| failedExecutor = Some(execId) | ||
|
|
@@ -345,7 +345,7 @@ private[spark] class TaskSchedulerImpl( | |
| if (TaskState.isFinished(state)) { | ||
| taskIdToTaskSetManager.remove(tid) | ||
| taskIdToExecutorId.remove(tid) match { | ||
| case Some(execId) => activeExecutorIdsWithLoads(execId) -= 1 | ||
| case Some(execId) => activeExecutorIdsWithTaskCount(execId) -= 1 | ||
| case None => | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will change that. |
||
| } | ||
|
|
@@ -468,7 +468,7 @@ private[spark] class TaskSchedulerImpl( | |
| var failedExecutor: Option[String] = None | ||
|
|
||
| synchronized { | ||
| if (activeExecutorIdsWithLoads.contains(executorId)) { | ||
| if (activeExecutorIdsWithTaskCount.contains(executorId)) { | ||
| val hostPort = executorIdToHost(executorId) | ||
| logError("Lost executor %s on %s: %s".format(executorId, hostPort, reason)) | ||
| removeExecutor(executorId, reason) | ||
|
|
@@ -490,7 +490,7 @@ private[spark] class TaskSchedulerImpl( | |
|
|
||
| /** Remove an executor from all our data structures and mark it as lost */ | ||
| private def removeExecutor(executorId: String, reason: ExecutorLossReason) { | ||
| activeExecutorIdsWithLoads -= executorId | ||
| activeExecutorIdsWithTaskCount -= executorId | ||
|
|
||
| val host = executorIdToHost(executorId) | ||
| val execs = executorsByHost.getOrElse(host, new HashSet) | ||
|
|
@@ -525,11 +525,11 @@ private[spark] class TaskSchedulerImpl( | |
| } | ||
|
|
||
| def isExecutorAlive(execId: String): Boolean = synchronized { | ||
| activeExecutorIdsWithLoads.contains(execId) | ||
| activeExecutorIdsWithTaskCount.contains(execId) | ||
| } | ||
|
|
||
| def isExecutorBusy(execId: String): Boolean = synchronized { | ||
| activeExecutorIdsWithLoads.getOrElse(execId, -1) > 0 | ||
| activeExecutorIdsWithTaskCount.getOrElse(execId, -1) > 0 | ||
| } | ||
|
|
||
| // By default, rack is unknown | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not your code, but please keep this private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I would rename it and update the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense.