SbloodyS commented on code in PR #16488:
URL: 
https://github.com/apache/dolphinscheduler/pull/16488#discussion_r1722975987


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DependentExecute.java:
##########
@@ -339,16 +339,25 @@ private ProcessInstance findLastProcessInterval(Long 
definitionCode, Long taskCo
     /**
      * get dependent result by task/process instance state
      *
-     * @param state state
+     * @param taskInstance task instance
      * @return DependResult
      */
-    private DependResult getDependResultByState(TaskExecutionStatus state) {
+    private DependResult getDependResultByStateAndRetry(TaskInstance 
taskInstance) {
 
+        TaskExecutionStatus state = taskInstance.getState();
         if (!state.isFinished()) {
             return DependResult.WAITING;
         } else if (state.isSuccess()) {
             return DependResult.SUCCESS;
         } else {
+            // Improvement the dependent result for workflow dependency tasks
+            // The reason is that within the maximum number of retries, the 
dependent task may start a new instance and run successfully
+            // If a failure result is returned directly, then the subsequent 
DAG of that dependent task node will not execute, and manual intervention in 
operations will be required
+            log.info("Task code: {}, task name: {}, retryTimes: {}, 
maxRetryTimes: {}",
+                    taskInstance.getTaskCode(), taskInstance.getName(), 
taskInstance.getRetryTimes(), taskInstance.getMaxRetryTimes());
+            if (taskInstance.getRetryTimes() < 
taskInstance.getMaxRetryTimes()) {
+                return DependResult.WAITING;
+            }

Review Comment:
   You need to verify the status of the workflow at the same time to avoid 
invalid checks.



##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DependentExecute.java:
##########
@@ -339,16 +339,25 @@ private ProcessInstance findLastProcessInterval(Long 
definitionCode, Long taskCo
     /**
      * get dependent result by task/process instance state
      *
-     * @param state state
+     * @param taskInstance task instance
      * @return DependResult
      */
-    private DependResult getDependResultByState(TaskExecutionStatus state) {
+    private DependResult getDependResultByStateAndRetry(TaskInstance 
taskInstance) {
 
+        TaskExecutionStatus state = taskInstance.getState();
         if (!state.isFinished()) {
             return DependResult.WAITING;
         } else if (state.isSuccess()) {
             return DependResult.SUCCESS;
         } else {
+            // Improvement the dependent result for workflow dependency tasks
+            // The reason is that within the maximum number of retries, the 
dependent task may start a new instance and run successfully
+            // If a failure result is returned directly, then the subsequent 
DAG of that dependent task node will not execute, and manual intervention in 
operations will be required

Review Comment:
   We don't need this comment.



-- 
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]

Reply via email to