From d587b5f03dd5a610b81b5acda746dfef7f40102a Mon Sep 17 00:00:00 2001 From: HQFGit <38312501+HQFGit@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:04:32 +0800 Subject: [PATCH] =?UTF-8?q?[Bug][Master][Fixes=2014216]workflow=20state=20?= =?UTF-8?q?keep=20READY=5FSTOP=20when=20sub=5Fprocess=20state=20=E2=80=A6?= =?UTF-8?q?=20(#14221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Bug] [Master] workflow state keep READY_STOP when sub_process state STOP Fixes #14216 * [Bug] [Master] workflow state keep READY_STOP when sub_process state STOP Fixes mvn spotless:apply#14216 * Update testFile.txt.crc * Update testFile.txt.crc * Delete testFile.txt.crc --- .../server/master/runner/WorkflowExecuteRunnable.java | 4 +++- .../plugin/task/api/enums/TaskExecutionStatus.java | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java index 6bc43ce69f..12fc29de29 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java @@ -1688,8 +1688,10 @@ public class WorkflowExecuteRunnable implements Callable { if (state == WorkflowExecutionStatus.READY_STOP) { List killList = getCompleteTaskByState(TaskExecutionStatus.KILL); List failList = getCompleteTaskByState(TaskExecutionStatus.FAILURE); + List stopList = getCompleteTaskByState(TaskExecutionStatus.STOP); WorkflowExecutionStatus executionStatus; - if (CollectionUtils.isNotEmpty(killList) || CollectionUtils.isNotEmpty(failList) || !isComplementEnd()) { + if (CollectionUtils.isNotEmpty(stopList) || CollectionUtils.isNotEmpty(killList) + || CollectionUtils.isNotEmpty(failList) || !isComplementEnd()) { executionStatus = WorkflowExecutionStatus.STOP; } else { executionStatus = WorkflowExecutionStatus.SUCCESS; diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/TaskExecutionStatus.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/TaskExecutionStatus.java index ac5f401c50..f706fe5d4e 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/TaskExecutionStatus.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/TaskExecutionStatus.java @@ -88,8 +88,12 @@ public enum TaskExecutionStatus { return this == TaskExecutionStatus.PAUSE; } + public boolean isStop() { + return this == TaskExecutionStatus.STOP; + } + public boolean isFinished() { - return isSuccess() || isKill() || isFailure() || isPause(); + return isSuccess() || isKill() || isFailure() || isPause() || isStop(); } public boolean isNeedFaultTolerance() {