davidzollo opened a new issue, #17004: URL: https://github.com/apache/dolphinscheduler/issues/17004
### 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 ``` public void cancelApplication() throws InterruptedException { if (process == null) { return; } // soft kill log.info("Begin to kill process process, pid is : {}", taskRequest.getProcessId()); process.destroy(); if (!process.waitFor(5, TimeUnit.SECONDS)) { process.destroyForcibly(); } log.info("Success kill task: {}, pid: {}", taskRequest.getTaskAppId(), taskRequest.getProcessId()); } ``` The methods AbstractCommandExecutor.cancelApplication need to be reviewed and potentially fixed to ensure they handle process tree termination correctly. The current implementation didn't cover all cases and could lead to child processes not being terminated as expected. This method can only ensure kill process itself. ### What you expected to happen Successfully killed all processes by this task ### How to reproduce You can create a seatunnel task like this (please choose seatunnel cluster mode) <img width="1433" alt="Image" src="https://github.com/user-attachments/assets/31494798-00ce-457e-a7f3-ab9c98217986" /> then stop it through button <img width="1681" alt="Image" src="https://github.com/user-attachments/assets/1f765790-4088-4ef5-92e1-3496a14b422b" /> You will find some child processes(63236 63239) are left when this task terminated <img width="1688" alt="Image" src="https://github.com/user-attachments/assets/722ca308-473e-417b-85d4-a15d29073f13" /> ### 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]
