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 07:15:04 UTC

[dolphinscheduler] branch fix_delay_time created (now 29967b5)

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

caishunfeng pushed a change to branch fix_delay_time
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git.


      at 29967b5  [Bug-8480][Server] fix delayed execution is useless

This branch includes the following new commits:

     new 29967b5  [Bug-8480][Server] fix delayed execution is useless

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[dolphinscheduler] 01/01: [Bug-8480][Server] fix delayed execution is useless

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 29967b56d1336c502b3304db23b209bcdf148f3d
Author: caishunfeng <53...@qq.com>
AuthorDate: Tue Mar 22 15:14:13 2022 +0800

    [Bug-8480][Server] fix delayed execution is useless
---
 .../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;