You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/24 09:53:16 UTC

[GitHub] [spark] AngersZhuuuu edited a comment on pull request #30131: [SPARK-33220][CORE]Use `scheduleWithFixedDelay` to avoid repeated unnecessary scheduling for a short time

AngersZhuuuu edited a comment on pull request #30131:
URL: https://github.com/apache/spark/pull/30131#issuecomment-715889934


   > if there is heavy gc after sending rpc request, but before task completes - fixed delay will be gc time + wait time vs just wait time.
   
   Double check the code of `ScheduleFutureTask`
   ```
   public void run() {
               boolean periodic = isPeriodic();
               if (!canRunInCurrentRunState(periodic))
                   cancel(false);
               else if (!periodic)
                   ScheduledFutureTask.super.run();
               else if (ScheduledFutureTask.super.runAndReset()) {
                   setNextRunTime();
                   reExecutePeriodic(outerTask);
               }
           }
   ```
   `resetNextRunTime` called before executing scheduled task. So the real interval between two task should be min(gc time , fixed delay)?
   
   1 gc before `setNextRunTime`, after gc task called then after fixed-delay, next task called
   2 gc between `setNextRunTime` and executing task,  next execute time setted, if gc time > fixed-delay, next task will be triggered immediately。 then interval between two task is gc time (also reasonable, same as current).
   3. gc after executing task, since next run time set, seems no problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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