richardmilles opened a new pull request, #18468: URL: https://github.com/apache/dolphinscheduler/pull/18468
## Was this PR generated or assisted by AI? YES. AI assistance was used for issue triage, locating the kill path, drafting the change/test, and preparing this PR description. The approach follows maintainer guidance on #16789 (treat already-exited / `No such process` as success) and was reviewed against the current `ProcessUtils.kill` flow. ## Purpose of the pull request Fixes #16789 When stopping a Flink task from the UI, the worker can log kill failure if the local client process has already exited. `ProcessUtils.kill()` still called `pstree`/`getPidList` for a non-zero cached `processId`; if the PID is gone, that throws and kill returns `false`, even though there is nothing left to kill. ## Brief change log - Before `pstree`, if `!isProcessAlive(processId)`, treat kill as success - If kill fails with an exception and the process is no longer alive, also treat as success (race window) - Add `ProcessUtilsTest#testKillAlreadyExitedProcessBeforePstree` ## Verify this pull request This change added tests and can be verified as follows: - Added `testKillAlreadyExitedProcessBeforePstree` (dead PID → success, no `pstree`) - Existing `ProcessUtilsTest` kill cases still cover SIGINT success / hard-kill failure / `processId == 0` ## Pull Request Notice [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) -- 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]
