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


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/condition/ConditionLogicTask.java:
##########
@@ -95,9 +95,11 @@ private DependResult calculateConditionResult() {
     private DependResult getDependResultForItem(ConditionDependentItem item, 
Map<Long, TaskInstance> taskInstanceMap) {
         TaskInstance taskInstance = taskInstanceMap.get(item.getDepTaskCode());
         if (taskInstance == null) {
-            log.info("The depend item: {} has not completed yet", 
DependResult.FAILED);
-            log.info("The dependent result will be {}", DependResult.FAILED);
-            return DependResult.FAILED;
+            // Dependent task not found – likely misconfigured task code
+            log.error("Dependent task definition missing, depTaskCode: {}", 
item.getDepTaskCode());
+            throw new RuntimeException(String.format(
+                    "Dependency validation failed: task code %d not found in 
current workflow. Check dependency config: %s",
+                    item.getDepTaskCode(), item));

Review Comment:
   The condition task might contains multiple predecessors, you cannot simple 
throw exception if task instance is null here.



##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/condition/ConditionLogicTask.java:
##########
@@ -95,9 +95,11 @@ private DependResult calculateConditionResult() {
     private DependResult getDependResultForItem(ConditionDependentItem item, 
Map<Long, TaskInstance> taskInstanceMap) {
         TaskInstance taskInstance = taskInstanceMap.get(item.getDepTaskCode());
         if (taskInstance == null) {
-            log.info("The depend item: {} has not completed yet", 
DependResult.FAILED);
-            log.info("The dependent result will be {}", DependResult.FAILED);
-            return DependResult.FAILED;
+            // Dependent task not found – likely misconfigured task code
+            log.error("Dependent task definition missing, depTaskCode: {}", 
item.getDepTaskCode());
+            throw new RuntimeException(String.format(
+                    "Dependency validation failed: task code %d not found in 
current workflow. Check dependency config: %s",
+                    item.getDepTaskCode(), item));

Review Comment:
   The condition task might contains multiple predecessors, you cannot simple 
throw exception if one task instance is null here.



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