Browse Source

Fix delay execution task will never be dispatched (#15751)

Co-authored-by: Eric Gao <ericgao.apache@gmail.com>
dev_wenjun_refactorMaster
Wenjun Ruan 8 months ago committed by GitHub
parent
commit
2e169076dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/GlobalTaskDispatchWaitingQueueLooper.java
  2. 5
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/operator/BaseTaskExecuteRunnableDispatchOperator.java

2
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/GlobalTaskDispatchWaitingQueueLooper.java

@ -69,7 +69,7 @@ public class GlobalTaskDispatchWaitingQueueLooper extends BaseDaemonThread imple
defaultTaskExecuteRunnable = globalTaskDispatchWaitingQueue.takeTaskExecuteRunnable();
try {
TaskExecutionStatus status = defaultTaskExecuteRunnable.getTaskInstance().getState();
if (status != TaskExecutionStatus.SUBMITTED_SUCCESS) {
if (status != TaskExecutionStatus.SUBMITTED_SUCCESS && status != TaskExecutionStatus.DELAY_EXECUTION) {
log.warn("The TaskInstance {} state is : {}, will not dispatch",
defaultTaskExecuteRunnable.getTaskInstance().getName(), status);
continue;

5
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/operator/BaseTaskExecuteRunnableDispatchOperator.java

@ -48,9 +48,10 @@ public abstract class BaseTaskExecuteRunnableDispatchOperator implements TaskExe
if (remainTime > 0) {
taskInstance.setState(TaskExecutionStatus.DELAY_EXECUTION);
taskInstanceDao.updateById(taskInstance);
log.info("Current taskInstance: {} is choose delay execution, delay time: {}/s, remainTime: {}/s",
log.info("Current taskInstance: {} is choose delay execution, delay time: {}/min, remainTime: {}/s",
taskInstance.getName(),
taskInstance.getDelayTime(), remainTime);
taskInstance.getDelayTime(),
remainTime);
}
globalTaskDispatchWaitingQueue.submitTaskExecuteRunnable(taskExecuteRunnable);
}

Loading…
Cancel
Save