Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement-16612][Master] For logical tasks on the Master, there should be support for dry run #16616

Merged
merged 17 commits into from
Oct 12, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.dolphinscheduler.server.master.runner.execute;

import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES;

import org.apache.dolphinscheduler.common.thread.BaseDaemonThread;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.utils.LogUtils;
Expand Down Expand Up @@ -86,8 +88,14 @@ public void run() {
try {
LogUtils.setTaskInstanceLogFullPathMDC(taskExecutionContext.getLogPath());
LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId());
AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus =
asyncTaskExecuteFunction.getAsyncTaskExecutionStatus();
AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus;
if (taskExecutionContext.getDryRun() == DRY_RUN_FLAG_YES) {
log.info(
"The current execute mode is dry run, will stop the logic task and set the taskInstance status to success");
asyncTaskExecutionStatus = AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.SUCCESS;
} else {
asyncTaskExecutionStatus = asyncTaskExecuteFunction.getAsyncTaskExecutionStatus();
}
switch (asyncTaskExecutionStatus) {
case RUNNING:
// If the task status is running, means the task real status is not finished. We
Expand Down
Loading