Skip to content
Snippets Groups Projects
Commit e271fde1 authored by root's avatar root
Browse files

Fixed a delay scheduling bug in the YARN branch, found by Patrick

parent 668b0dc6
No related branches found
No related tags found
No related merge requests found
......@@ -454,10 +454,10 @@ private[spark] class ClusterTaskSetManager(
val taskId = sched.newTaskId()
// Figure out whether this should count as a preferred launch
val taskLocality =
if (isProcessLocalLocation(task, hostPort)) TaskLocality.PROCESS_LOCAL else
if (isHostLocalLocation(task, hostPort)) TaskLocality.NODE_LOCAL else
if (isRackLocalLocation(task, hostPort)) TaskLocality.RACK_LOCAL else
TaskLocality.ANY
if (isProcessLocalLocation(task, hostPort)) TaskLocality.PROCESS_LOCAL
else if (isHostLocalLocation(task, hostPort)) TaskLocality.NODE_LOCAL
else if (isRackLocalLocation(task, hostPort)) TaskLocality.RACK_LOCAL
else TaskLocality.ANY
val prefStr = taskLocality.toString
logInfo("Starting task %s:%d as TID %s on slave %s: %s (%s)".format(
taskSet.id, index, taskId, execId, hostPort, prefStr))
......@@ -467,7 +467,7 @@ private[spark] class ClusterTaskSetManager(
val info = new TaskInfo(taskId, index, time, execId, hostPort, taskLocality)
taskInfos(taskId) = info
taskAttempts(index) = info :: taskAttempts(index)
if (TaskLocality.NODE_LOCAL == taskLocality) {
if (taskLocality == TaskLocality.PROCESS_LOCAL || taskLocality == TaskLocality.NODE_LOCAL) {
lastPreferredLaunchTime = time
}
// Serialize and return the task
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment