KaiSong-UK opened a new pull request, #18428:
URL: https://github.com/apache/dolphinscheduler/pull/18428
## What changes were made?
Fixed `ProcessUtils.isProcessAlive()` to properly handle the case where
`kill -0` fails with "Operation not permitted" — which means the process exists
but the current user doesn't have permission to signal it (e.g., root-owned
`sudo` parent process when task runs as tenant user).
Previously, any exception from `kill -0` was treated as "process not alive",
causing the worker to incorrectly report kill success while child processes
remained alive and the workflow stuck in `READY_STOP`.
## Root Cause
- `ProcessUtils.isProcessAlive` treats every exception from
`OSUtils.exeCmd("kill -0 <pid>")` as "not alive"
- When a tenant user checks a root-owned process, `kill -0` returns
"Operation not permitted" (exit code 1), but the process IS alive
- This caused `sendKillSignal` to report all processes already terminated
when they weren't
## Fix
Added `isProcessAliveByAlternativeCheck()` fallback method:
- On Linux: checks `/proc/<pid>` directory existence (no permission required)
- On other OS: uses `ps -p <pid>` command
## Related Issue
Closes #18311
--
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]