apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code
https://dolphinscheduler.apache.org/
Apache License 2.0
12.73k stars 4.58k forks source link

[Bug] [dolphinscheduler-master] Can't stop the subProcess instance successfully via STOP its master process instance #16467

Open topsli opened 1 month ago

topsli commented 1 month ago

Search before asking

What happened

Can't stop the subProcess instance successfully via STOP its master process instance

What you expected to happen

Expect stop all the subProcess instance successful via STOP the master process instance

How to reproduce

1.create a workflow, its need a SubProcess task and refer it to another workflow

  1. start up this master workflow
  2. try to STOP it
  3. the master process instance stopped, but the subPorcess instance is still running and the task of this subProcess instance also running to. (May be you need to check its state in DB if the UI haven't shows subProcess instances)

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

Code of Conduct

topsli commented 1 month ago
  1. This issue is at the method of putMasterTaskExecuteRunnable in class MasterTaskExecutorHolder , which is no usages. But in the operate method of LogicITaskInstanceKillOperationFunction class, we can find its use MasterTaskExecutorHolder.getMasterTaskExecutor(taskInstanceId) to get masterTaskExecutor , and then to use masterTaskExecutor to cancel task. So, it's should put masterTaskExecutor first in class MasterTaskExecutorHolder .

2.Another point of this issue at the method of sendToSubProcess in class SubWorkflowLogicTask, when new WorkflowInstanceStateChangeEvent object, it should use subProcessInstance.getId() to set sourceProcessInstanceId.

3.The DynamicLogicTask have same issue, resolve solution same to the SubWorkflowLogicTask.