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

   ### 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
   
   When killing tasks in Worker, the thread executing the task is not actually 
closed, so the task status is "kill" but it is still running in practice. This 
indirectly affects the ability to rerun the task. 
   
   
![image](https://user-images.githubusercontent.com/6326356/234825553-a539b619-6118-4e6d-a343-a16da9c0e87d.png)
   
![image](https://user-images.githubusercontent.com/6326356/234825841-bdd2ebfb-77fb-43ab-9ad0-2a32f31c614c.png)
   
   
   ### What you expected to happen
   
   I believe that when closing a task, at least the task execution thread 
should be closed . This is because not all tasks will start a process, but all 
tasks must execute commands through a thread.
   
   ### How to reproduce
   
   Based on the current implementation, I came up with a method to close the 
thread. Here are the steps for reference:
   
   1. In the WorkerExecService, maintain a futureMap for each task.
   2. When closing a task, retrieve the future object from the futureMap and 
call the cancel() method.
   
   
![image](https://user-images.githubusercontent.com/6326356/234831830-cc3cae12-387d-472e-8aea-965c622f5c35.png)
   
   
![image](https://user-images.githubusercontent.com/6326356/234832894-410d1de7-44db-4621-a2ed-7b688b18cd64.png)
   
   
![image](https://user-images.githubusercontent.com/6326356/234833092-4998c7b4-73e9-4b86-8b78-1220c4e3b700.png)
   
   
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [ ] 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