Skip to content

Commit

Permalink
Avoid assigning tasks to lost executors
Browse files Browse the repository at this point in the history
  • Loading branch information
GraceH committed Jul 20, 2015
1 parent 5bdf16d commit 30a9ad0
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val rpcEnv: Rp

// Make fake resource offers on all executors
private def makeOffers() {
launchTasks(scheduler.resourceOffers(executorDataMap.map { case (id, executorData) =>
new WorkerOffer(id, executorData.executorHost, executorData.freeCores)
launchTasks(scheduler.resourceOffers(executorDataMap
.filterKeys(!executorsPendingToRemove.contains(_))
.map { case (id, executorData) =>
new WorkerOffer(id, executorData.executorHost, executorData.freeCores)
}.toSeq))
}

Expand All @@ -181,9 +183,11 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val rpcEnv: Rp

// Make fake resource offers on just one executor
private def makeOffers(executorId: String) {
val executorData = executorDataMap(executorId)
launchTasks(scheduler.resourceOffers(
Seq(new WorkerOffer(executorId, executorData.executorHost, executorData.freeCores))))
if (!executorsPendingToRemove.contains(executorId)) {
val executorData = executorDataMap(executorId)
launchTasks(scheduler.resourceOffers(
Seq(new WorkerOffer(executorId, executorData.executorHost, executorData.freeCores))))
}
}

// Launch tasks returned by a set of resource offers
Expand Down

0 comments on commit 30a9ad0

Please sign in to comment.