You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/12 03:56:24 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #11424: [hotfix] Fix find last process instance in dependent task is not correct

ruanwenjun commented on code in PR #11424:
URL: https://github.com/apache/dolphinscheduler/pull/11424#discussion_r944094962


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DependentExecute.java:
##########
@@ -187,12 +187,6 @@ private DependResult getDependTaskResult(long taskCode, ProcessInstance processI
      */
     private ProcessInstance findLastProcessInterval(Long definitionCode, DateInterval dateInterval) {
 
-        ProcessInstance runningProcess = processService.findLastRunningProcess(definitionCode,
-                dateInterval.getStartTime(), dateInterval.getEndTime());
-        if (runningProcess != null) {
-            return runningProcess;
-        }
-

Review Comment:
   AFAIK, this method is just want to find the latest `processInstance` by `endTime` or `scheduleTime`.
   ```
   find the last one process instance that :
        * 1. manual run and finish between the interval
        * 2. schedule run and schedule time between the interval
        private ProcessInstance findLastProcessInterval(Long definitionCode, DateInterval dateInterval)
   ```
   It doesn't care about the before processInstance.
   
   For example: 
   If I have a process instance manual executed 5 times today, and I use this method to query today process instance.
   ```
   11:00 finished
   10:00 finished
   9:00 running
   8:00 finished
   7:00 finished
   ```
   This method should return the latest processInstance(11:00), not 9:00.
   



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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