You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "KaiSong-UK (via GitHub)" <gi...@apache.org> on 2026/07/23 01:34:33 UTC

[PR] [Fix-16789] Ignore 'No such process' error when Flink task process already exited [dolphinscheduler]

KaiSong-UK opened a new pull request, #18435:
URL: https://github.com/apache/dolphinscheduler/pull/18435

   ## What changes were proposed in this pull request?
   
   When stopping a Flink task from the UI, if the underlying process has already exited naturally before the kill signal is sent, the `pstree` command fails with a "No such process" error, causing the kill operation to report failure.
   
   This PR adds a process liveness check (`isProcessAlive`) before attempting to get the PID list via `pstree`, so that already-terminated processes are treated as successfully killed rather than as errors.
   
   ## Why are the changes needed?
   
   Fixes #16789 - stop Flink job error when process already exited.
   
   The root cause: in `ProcessUtils.kill()`, after verifying `processId != 0`, it immediately calls `getPidList(processId)` which executes `pstree -p <pid>`. If the process has already exited, `pstree` fails and throws an exception, which is caught by the outer catch block and returns `false`, leading to an error log "Failed to kill process tree".
   
   ## How was this patch tested?
   
   - Logic verification: `isProcessAlive()` uses `kill -0 <pid>` which is a standard POSIX method to check process existence without sending a signal. If the process doesn't exist, it returns false.
   - The fix is a safe early return: if the process has already exited, we skip the kill signal cascade entirely and report success.
   
   ## Related issues
   
   Closes #16789


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Fix-16789] Ignore 'No such process' error when Flink task process already exited [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS closed pull request #18435: [Fix-16789] Ignore 'No such process' error when Flink task process already exited
URL: https://github.com/apache/dolphinscheduler/pull/18435


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org