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


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/statemachine/TaskSubmittedStateAction.java:
##########
@@ -109,7 +111,18 @@ public void onDispatchEvent(final 
IWorkflowExecutionRunnable workflowExecutionRu
                     taskInstance.getDelayTime(),
                     remainTimeMills);
         }
-        taskExecutionRunnable.initializeTaskExecutionContext();
+
+        try {
+            taskExecutionRunnable.initializeTaskExecutionContext();
+        } catch (DataAccessResourceFailureException ex) {
+            log.error("Database/resource failure during task context 
initialization, taskName: {}",
+                    taskInstance.getName(), ex);
+            throw ex;
+        } catch (Exception ex) {
+            log.error("Failed to initialize task execution context, taskName: 
{}", taskInstance.getName(), ex);

Review Comment:
   > catch (Exception ex) {
   >             if(ExceptionUtils.isDatabaseConnectedFailedException(ex)) {
   >                 throw ex;
   >             }
   >             log.error("Failed to initialize task execution context, 
taskName: {}", taskInstance.getName(), ex);
   
   an excellent suggestion!



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