ruanwenjun commented on code in PR #16461:
URL:
https://github.com/apache/dolphinscheduler/pull/16461#discussion_r1716609457
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncTaskExecutionContext.java:
##########
@@ -59,19 +59,17 @@ public AsyncTaskExecutionContext(@NonNull
TaskExecutionContext taskExecutionCont
this.executeInterval =
Math.max(asyncTaskExecuteFunction.getAsyncTaskStateCheckInterval().toMillis(),
1000L);
}
- public void refreshStartTime() {
- if (executeTimes == 0) {
+ public synchronized void refreshStartTime() {
+ if (executeTimes != 0) {
// The first time doesn't have delay
- executeTimes++;
- } else {
currentStartTime = System.currentTimeMillis();
}
+ executeTimes++;
}
@Override
public long getDelay(TimeUnit unit) {
- long nextExecuteTimeDelay = Math.min(currentStartTime +
executeInterval, timeout) - System.currentTimeMillis();
- return unit.convert(nextExecuteTimeDelay, TimeUnit.MILLISECONDS);
+ return unit.convert(this.executeInterval, TimeUnit.MILLISECONDS);
Review Comment:
Have you test this? Once the element changed in the delay queue, the delay
time will recalculate, in this pr the delay time will be a fixed value, this
will cause some function will never be triggered.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]