njnu-seafish commented on code in PR #17759:
URL: 
https://github.com/apache/dolphinscheduler/pull/17759#discussion_r2598250029


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/TaskSubmittedStateAction.java:
##########
@@ -109,7 +111,17 @@ public void onDispatchEvent(final 
IWorkflowExecutionRunnable workflowExecutionRu
                     taskInstance.getDelayTime(),
                     remainTimeMills);
         }
-        taskExecutionRunnable.initializeTaskExecutionContext();
+        try {
+            taskExecutionRunnable.initializeTaskExecutionContext();
+        } catch (Exception ex) {
+            log.error("Current taskInstance: {} initializeTaskExecutionContext 
error", taskInstance.getName(), ex);
+            final TaskFatalLifecycleEvent taskFatalEvent = 
TaskFatalLifecycleEvent.builder()
+                    .taskExecutionRunnable(taskExecutionRunnable)
+                    .endTime(new Date())
+                    .build();
+            
taskExecutionRunnable.getWorkflowEventBus().publish(taskFatalEvent);
+            return;
+        }

Review Comment:
   > You need to create a `TaskFatalException`, and throw `TaskFatalException` 
here and handle `TaskFatalException` at `WorkflowEventBusFireWorker`.
   
   ok. first throw TaskFatalException then publish TaskFatalLifecycleEvent



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