shouwangyw commented on code in PR #16616:
URL: 
https://github.com/apache/dolphinscheduler/pull/16616#discussion_r1796369247


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java:
##########
@@ -100,6 +101,15 @@ public void run() {
             TaskInstanceLogHeader.printInitializeTaskContextHeader();
             initializeTask();
 
+            if (DRY_RUN_FLAG_YES == taskExecutionContext.getDryRun()) {
+                
taskExecutionContext.setCurrentExecutionStatus(TaskExecutionStatus.SUCCESS);
+                taskExecutionContext.setEndTime(System.currentTimeMillis());
+                
MasterTaskExecutorHolder.removeMasterTaskExecutor(taskExecutionContext.getTaskInstanceId());
+                
logicTaskInstanceExecutionEventSenderManager.successEventSender().sendMessage(taskExecutionContext);
+                log.info(
+                        "The current execute mode is dry run, will stop the 
logic task and set the taskInstance status to success");
+                return;
+            }

Review Comment:
   > It's better to move this after `beforeExecute` I am not sure if the 
statemachine will throw exception, since the task lifecycle might miss 
`running` event, so the task state will be dispatched, and dispatched task 
cannot be converted to success.
   
   I find the implementation in `WorkerTaskExecutor`,this is before 
`beforeExecute`.



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