Skip to content

Commit f26e382

Browse files
author
Davies Liu
committed
[SPARK-7624] Revert "[SPARK-4939] revive offers periodically in LocalBackend" in 1.3 branch
This reverts commit e196da8. Author: Davies Liu <davies@databricks.com> Closes #6337 from davies/revert_revive and squashes the following commits: be73f96 [Davies Liu] Revert "[SPARK-4939] revive offers periodically in LocalBackend"
1 parent a64e097 commit f26e382

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

core/src/main/scala/org/apache/spark/scheduler/local/LocalBackend.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package org.apache.spark.scheduler.local
1919

2020
import java.nio.ByteBuffer
2121

22-
import scala.concurrent.duration._
23-
2422
import akka.actor.{Actor, ActorRef, Props}
2523

2624
import org.apache.spark.{Logging, SparkContext, SparkEnv, TaskState}
@@ -48,8 +46,6 @@ private[spark] class LocalActor(
4846
private val totalCores: Int)
4947
extends Actor with ActorLogReceive with Logging {
5048

51-
import context.dispatcher // to use Akka's scheduler.scheduleOnce()
52-
5349
private var freeCores = totalCores
5450

5551
private val localExecutorId = SparkContext.DRIVER_IDENTIFIER
@@ -78,16 +74,11 @@ private[spark] class LocalActor(
7874

7975
def reviveOffers() {
8076
val offers = Seq(new WorkerOffer(localExecutorId, localExecutorHostname, freeCores))
81-
val tasks = scheduler.resourceOffers(offers).flatten
82-
for (task <- tasks) {
77+
for (task <- scheduler.resourceOffers(offers).flatten) {
8378
freeCores -= scheduler.CPUS_PER_TASK
8479
executor.launchTask(executorBackend, taskId = task.taskId, attemptNumber = task.attemptNumber,
8580
task.name, task.serializedTask)
8681
}
87-
if (tasks.isEmpty && scheduler.activeTaskSets.nonEmpty) {
88-
// Try to reviveOffer after 1 second, because scheduler may wait for locality timeout
89-
context.system.scheduler.scheduleOnce(1000 millis, self, ReviveOffers)
90-
}
9182
}
9283
}
9384

0 commit comments

Comments
 (0)