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/10/19 14:36:53 UTC

[GitHub] [dolphinscheduler] DarkAssassinator commented on a diff in pull request #12448: [Bug] Improve the scenario of continuing to submit subsequent tasks after failure

DarkAssassinator commented on code in PR #12448:
URL: https://github.com/apache/dolphinscheduler/pull/12448#discussion_r999551015


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java:
##########
@@ -419,6 +416,25 @@ public void taskFinished(TaskInstance taskInstance) throws StateEventHandleExcep
         }
     }
 
+    /**
+     * continue to submit subsequent tasks after failure
+     *
+     * if there are subsequent tasks:
+     *      1. nodes are parallel;
+     *      2. nodes are serial and failed task type is condition;
+     *      3. nodes are serial and next task type is condition;
+     */
+    private void failureContinueSubmitPostNodes(TaskInstance taskInstance) throws StateEventHandleException {
+        if (!DagHelper.haveAnyNodeAfterNode(Long.toString(taskInstance.getTaskCode()), dag)) {
+            submitPostNode(Long.toString(taskInstance.getTaskCode()));
+        } else {
+            if (taskInstance.isConditionsTask()
+                    || DagHelper.haveConditionsAfterNode(Long.toString(taskInstance.getTaskCode()), dag)) {
+                submitPostNode(Long.toString(taskInstance.getTaskCode()));
+            }
+        }

Review Comment:
   could we move these conditions to a private function or workflow util, such as `shouldSubmitPostNode`? because all these condition should submitPostNode, might be clearer for reading. WDYT. 



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