You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/03/22 11:56:36 UTC

[dolphinscheduler] branch 2.0.6-prepare updated: [Bug-8480][Server] fix delayed execution is useless (#9085)

This is an automated email from the ASF dual-hosted git repository.

caishunfeng pushed a commit to branch 2.0.6-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.6-prepare by this push:
     new a4699d8  [Bug-8480][Server] fix delayed execution is useless (#9085)
a4699d8 is described below

commit a4699d8f246a219fb9090473d37514e96ccd5776
Author: caishunfeng <ca...@gmail.com>
AuthorDate: Tue Mar 22 19:56:30 2022 +0800

    [Bug-8480][Server] fix delayed execution is useless (#9085)
    
    Co-authored-by: caishunfeng <53...@qq.com>
---
 .../service/process/ProcessService.java            | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
index ac10db2..1a55f61 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
+++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@@ -454,7 +454,6 @@ public class ProcessService {
 
     /**
      * recursive delete all task instance by process instance id
-     * @param processInstanceId
      */
     public void deleteWorkTaskInstanceByProcessInstanceId(int processInstanceId) {
         List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId);
@@ -1337,6 +1336,9 @@ public class ProcessService {
         taskInstance.setExecutorId(processInstance.getExecutorId());
         taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority());
         taskInstance.setState(getSubmitTaskState(taskInstance, processInstanceState));
+        if (taskInstance.getSubmitTime() == null) {
+            taskInstance.setSubmitTime(new Date());
+        }
         if (taskInstance.getFirstSubmitTime() == null) {
             taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime());
         }
@@ -1717,9 +1719,9 @@ public class ProcessService {
      * @reutrn
      */
     public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host,
-                                String executePath,
-                                String logPath,
-                                int taskInstId) {
+                                   String executePath,
+                                   String logPath,
+                                   int taskInstId) {
         taskInstance.setState(state);
         taskInstance.setStartTime(startTime);
         taskInstance.setHost(host);
@@ -1745,14 +1747,13 @@ public class ProcessService {
      * @param endTime endTime
      * @param taskInstId taskInstId
      * @param varPool varPool
-     * @return
      */
     public boolean changeTaskState(TaskInstance taskInstance, ExecutionStatus state,
-                                Date endTime,
-                                int processId,
-                                String appIds,
-                                int taskInstId,
-                                String varPool) {
+                                   Date endTime,
+                                   int processId,
+                                   String appIds,
+                                   int taskInstId,
+                                   String varPool) {
         taskInstance.setPid(processId);
         taskInstance.setAppLink(appIds);
         taskInstance.setState(state);
@@ -2464,7 +2465,7 @@ public class ProcessService {
                 taskCodeVersionMap.put(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion());
             }
         }
-        taskCodeVersionMap.forEach((code,version) -> {
+        taskCodeVersionMap.forEach((code, version) -> {
             taskDefinitionLogs.add((TaskDefinitionLog) this.findTaskDefinition(code, version));
         });
         return taskDefinitionLogs;