Search before asking
What happened
After a failed task instance is manually set to forced success, its state is correctly changed to FORCED_SUCCESS.
If the workflow instance is then recovered using "Recovery Failed":
- the forced-success task is skipped as expected;
- downstream tasks continue to run;
- but the state of the forced-success task instance is changed from
FORCED_SUCCESS to SUCCESS.
The workflow can continue normally, but the information indicating that the task was completed through manual intervention is lost. The task then appears to have completed successfully through normal execution.
This behavior was reproduced on a deployment based on 3.4.2 and was also confirmed in the current dev branch source code.
What you expected to happen
After recovering the failed workflow:
- the forced-success task should be treated as successful for dependency and workflow topology evaluation;
- downstream tasks should continue to run;
- the task instance state should remain
FORCED_SUCCESS.
Recovering a workflow should not convert an existing FORCED_SUCCESS state to SUCCESS.
How to reproduce
- Create a workflow containing at least two sequential tasks:
A -> B.
- Run the workflow and make task A fail.
- Perform the "Force Success" operation on task A.
- Confirm that the state of task A is
FORCED_SUCCESS.
- Perform the "Recovery Failed" operation on the workflow instance.
- Wait for downstream task B to start.
- Check the state of task A again.
Actual result:
FORCED_SUCCESS -> SUCCESS
Expected result:
FORCED_SUCCESS -> FORCED_SUCCESS
Anything else
The issue is still present in the dev branch at commit:
eca5d5e3df52f812c7820b5da6de5feb5cc140e4
The relevant source-code path is:
RecoverFailureTaskCommandHandler retains a FORCED_SUCCESS task instance when rebuilding the workflow execution graph because only FAILURE, KILL, and PAUSE tasks are recreated or recovered.
- The retained task receives a
TaskStartLifecycleEvent when the recovered workflow starts processing the execution graph.
TaskForceSuccessStateAction inherits the start-event behavior from TaskSuccessStateAction.
- The inherited success handling unconditionally persists the task state as
TaskExecutionStatus.SUCCESS.
Relevant files:
dolphinscheduler-master/.../command/handler/RecoverFailureTaskCommandHandler.java
dolphinscheduler-master/.../task/statemachine/TaskForceSuccessStateAction.java
dolphinscheduler-master/.../task/statemachine/TaskSuccessStateAction.java
dolphinscheduler-master/.../task/statemachine/AbstractTaskStateAction.java
This does not prevent downstream execution, but it removes the audit distinction between a normally successful task and a manually forced-success task.
Version
dev
Are you willing to submit a PR?
Code of Conduct
Search before asking
What happened
After a failed task instance is manually set to forced success, its state is correctly changed to
FORCED_SUCCESS.If the workflow instance is then recovered using "Recovery Failed":
FORCED_SUCCESStoSUCCESS.The workflow can continue normally, but the information indicating that the task was completed through manual intervention is lost. The task then appears to have completed successfully through normal execution.
This behavior was reproduced on a deployment based on 3.4.2 and was also confirmed in the current
devbranch source code.What you expected to happen
After recovering the failed workflow:
FORCED_SUCCESS.Recovering a workflow should not convert an existing
FORCED_SUCCESSstate toSUCCESS.How to reproduce
A -> B.FORCED_SUCCESS.Actual result:
Expected result:
Anything else
The issue is still present in the
devbranch at commit:The relevant source-code path is:
RecoverFailureTaskCommandHandlerretains aFORCED_SUCCESStask instance when rebuilding the workflow execution graph because onlyFAILURE,KILL, andPAUSEtasks are recreated or recovered.TaskStartLifecycleEventwhen the recovered workflow starts processing the execution graph.TaskForceSuccessStateActioninherits the start-event behavior fromTaskSuccessStateAction.TaskExecutionStatus.SUCCESS.Relevant files:
dolphinscheduler-master/.../command/handler/RecoverFailureTaskCommandHandler.javadolphinscheduler-master/.../task/statemachine/TaskForceSuccessStateAction.javadolphinscheduler-master/.../task/statemachine/TaskSuccessStateAction.javadolphinscheduler-master/.../task/statemachine/AbstractTaskStateAction.javaThis does not prevent downstream execution, but it removes the audit distinction between a normally successful task and a manually forced-success task.
Version
dev
Are you willing to submit a PR?
Code of Conduct