Skip to content

[Fix-16789] Fix flink job stop error when process has already exited#18289

Closed
KaiSong-UK wants to merge 4 commits into
apache:devfrom
KaiSong-UK:fix-16789-flink-stop-error
Closed

[Fix-16789] Fix flink job stop error when process has already exited#18289
KaiSong-UK wants to merge 4 commits into
apache:devfrom
KaiSong-UK:fix-16789-flink-stop-error

Conversation

@KaiSong-UK

Copy link
Copy Markdown

What is the purpose of the change

fix #16789

When stopping a Flink task through the DolphinScheduler page, if the Flink process has already exited automatically before the kill signal is sent, the pstree command in ProcessUtils.getPidList() throws an exception because the process no longer exists. This causes the kill() method to return false and log an error message, even though the process termination is actually the expected behavior.

Brief changelog

  • Modified ProcessUtils.getPidList() to return an empty list when pstree fails (process has already exited), instead of throwing an exception
  • Changed the log level from error to warn with a more descriptive message indicating the process may have already exited

Verifying this change

When a Flink task process exits on its own before the stop command is issued, the kill operation will now succeed silently instead of reporting an error.

Does this PR introduce breaking changes?

No.

@SbloodyS

Copy link
Copy Markdown
Member

Please abide by the PR specification before submitting PR and submit it after the local test has passed. Using AI to blindly submit PR will weaken the trust value of the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Flink] stop flink job error

2 participants