Skip to content
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

[SPARK-17304] Fix perf. issue caused by TaskSetManager.abortIfCompletelyBlacklisted #14871

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ private[spark] class TaskSchedulerImpl(
}
}
}
if (!launchedTask) {
taskSet.abortIfCompletelyBlacklisted(executorIdToHost.keys)
}
return launchedTask
}

Expand Down Expand Up @@ -326,12 +323,19 @@ private[spark] class TaskSchedulerImpl(
// Take each TaskSet in our scheduling order, and then offer it each node in increasing order
// of locality levels so that it gets a chance to launch local tasks on all of them.
// NOTE: the preferredLocality order: PROCESS_LOCAL, NODE_LOCAL, NO_PREF, RACK_LOCAL, ANY
var launchedTask = false
for (taskSet <- sortedTaskSets; maxLocality <- taskSet.myLocalityLevels) {
do {
launchedTask = resourceOfferSingleTaskSet(
for (taskSet <- sortedTaskSets) {
var launchedAnyTask = false
var launchedTaskAtMaxLocality = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's super verbose, but to minimize how confusing this code is, what about calling this launchedTaskAtCurrentMaxLocality, and renaming maxLocality below to currentMaxLocality?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea; updated.

for (maxLocality <- taskSet.myLocalityLevels) {
do {
launchedTaskAtMaxLocality = resourceOfferSingleTaskSet(
taskSet, maxLocality, shuffledOffers, availableCpus, tasks)
} while (launchedTask)
launchedAnyTask |= launchedTaskAtMaxLocality
} while (launchedTaskAtMaxLocality)
}
if (!launchedAnyTask) {
taskSet.abortIfCompletelyBlacklisted(executorIdToHost.keys)
}
}

if (tasks.size > 0) {
Expand Down