Fix task instance which status is dispatch will not be failover (#16110)

(cherry picked from commit a59ecf2aa19f4acd8d9981d14abe4d0c0d8e7fec)
This commit is contained in:
Wenjun Ruan 2024-06-05 13:31:29 +08:00 committed by GitHub
parent 72b402422a
commit 50c434e6c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1226,12 +1226,12 @@ public class WorkflowExecuteRunnable implements IWorkflowExecuteRunnable {
|| state == TaskExecutionStatus.DISPATCH
|| state == TaskExecutionStatus.SUBMITTED_SUCCESS
|| state == TaskExecutionStatus.DELAY_EXECUTION) {
// try to take over task instance
if (state == TaskExecutionStatus.SUBMITTED_SUCCESS || state == TaskExecutionStatus.DELAY_EXECUTION
|| state == TaskExecutionStatus.DISPATCH) {
if (state == TaskExecutionStatus.SUBMITTED_SUCCESS
|| state == TaskExecutionStatus.DELAY_EXECUTION) {
// The taskInstance is not in running, directly takeover it
} else if (tryToTakeOverTaskInstance(existTaskInstance)) {
log.info("Success take over task {}", existTaskInstance.getName());
// If the taskInstance has already dispatched to worker then will try to take-over it
log.info("Success take over task {} -> status: {}", existTaskInstance.getName(), state);
continue;
} else {
// set the task instance state to fault tolerance