SbloodyS commented on code in PR #15289:
URL:
https://github.com/apache/dolphinscheduler/pull/15289#discussion_r1418484505
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DependentExecute.java:
##########
@@ -318,21 +316,12 @@ private void addItemVarPool(String varPoolStr, Long
endTime) {
*/
private ProcessInstance findLastProcessInterval(Long definitionCode,
DateInterval dateInterval, int testFlag) {
- ProcessInstance lastSchedulerProcess =
-
processInstanceDao.queryLastSchedulerProcessInterval(definitionCode,
dateInterval, testFlag);
+ // Task instance cannot run without process instance,
+ // we should only use `scheduleTime` to search for process instances,
+ // as `dateInterval` is calculated based on the `scheduleTime` of the
+ // process instance where the `dependent` node is located.
- ProcessInstance lastManualProcess =
-
processInstanceDao.queryLastManualProcessInterval(definitionCode, dateInterval,
testFlag);
-
- if (lastManualProcess == null) {
- return lastSchedulerProcess;
- }
- if (lastSchedulerProcess == null) {
- return lastManualProcess;
- }
-
- // In the time range, there are both manual and scheduled workflow
instances, return the last workflow instance
- return lastManualProcess.getId() > lastSchedulerProcess.getId() ?
lastManualProcess : lastSchedulerProcess;
Review Comment:
In this case B.B1 in scheduleTime `2023-12-03` will find A.A1 in
`2023-11-30`'s processInstance through `queryLastManualProcessInterval`. And
will continue with the next step of detection of
`dependResultByProcessInstance`. The `result` of
`dependResultByProcessInstance` will be `WAITING`. I think that's exactly what
we wish for.
--
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]