Github user mridulm commented on a diff in the pull request: https://github.com/apache/spark/pull/892#discussion_r13598180 --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala --- @@ -388,7 +386,7 @@ private[spark] class TaskSetManager( val curTime = clock.getTime() var allowedLocality = getAllowedLocalityLevel(curTime) - if (allowedLocality > maxLocality) { + if (allowedLocality > maxLocality && myLocalityLevels.contains(maxLocality)) { allowedLocality = maxLocality // We're not allowed to search for farther-away tasks } --- End diff -- Editing previous comment: Suppose maxLocality == PROCESS_LOCAL while allowedLocality == RACK_LOCAL (by virture of having waited long enough for a free executor). Instead of restricting schedule to upto PROCESS_LOCAL, this will now relax it all the way till RACK_LOCAL - which is incorrect (myLocalityLevels might not have PROCESS_LOCAL but could have NODE_LOCAL for example).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---