reele opened a new issue, #16767:
URL: https://github.com/apache/dolphinscheduler/issues/16767

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   Normally, `FailoverCoordinator.getFailoverWorkflowsForMaster()` finds all 
workflows that need failover. When the sub-workflow task's 
`TaskExecutionRunnable.failover()` method is called, 
`takeOverTaskFromExecutor()` now returns `false` if the task is a logic task. 
This results in the creation of a new sub-workflow task instance and the 
publication of its `TaskStartLifecycleEvent`, causing the sub-workflow to run 
again during the failover process.
   
   
https://github.com/apache/dolphinscheduler/blob/071994933b05850e7dd5f7bccbf45d867640e244/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/runnable/TaskExecutionRunnable.java#L120-L135
   
   so i think it would be better to check the sub-workflow instance properly(by 
dao or server communicate) and take it over, instead of creating a whole new 
task instance.
   
   ### What you expected to happen
   
   Take over sub-workflow task if the sub-workflow instance is in good status.
   
   ### How to reproduce
   
   execute a workflow with sub-workflow, restart the master-server, query the 
database
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to