Github user kayousterhout commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4147#discussion_r24056992
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/local/LocalBackend.scala ---
    @@ -74,10 +78,16 @@ private[spark] class LocalActor(
     
       def reviveOffers() {
         val offers = Seq(new WorkerOffer(localExecutorId, 
localExecutorHostname, freeCores))
    -    for (task <- scheduler.resourceOffers(offers).flatten) {
    -      freeCores -= scheduler.CPUS_PER_TASK
    -      executor.launchTask(executorBackend, taskId = task.taskId, 
attemptNumber = task.attemptNumber,
    -        task.name, task.serializedTask)
    +    val tasks = scheduler.resourceOffers(offers).flatten
    +    if (tasks.nonEmpty) {
    +      for (task <- tasks) {
    +        freeCores -= scheduler.CPUS_PER_TASK
    +        executor.launchTask(executorBackend, taskId = task.taskId,
    +          attemptNumber = task.attemptNumber, task.name, 
task.serializedTask)
    +      }
    +    } else if (scheduler.activeTaskSets.nonEmpty) {
    +      // Try to reviveOffer after 1 second, because scheduler may wait for 
locality timeout
    +      context.system.scheduler.scheduleOnce(1000 millis , self, 
ReviveOffers)
    --- End diff --
    
    super nit: extra space after "millis"


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to