Skip to content

Conversation

@davidzollo
Copy link
Contributor

@davidzollo davidzollo commented Feb 8, 2025

  • update the ProcessUtils.kill method to ensure it correctly handles process tree termination and direct process destruction.
  • update the AbstractCommandExecutor.cancelApplication method to ensure it correctly handles process termination, including logging and error handling.

close #17004

@davidzollo davidzollo added the bug Something isn't working label Feb 10, 2025
Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR generating by AI? This could potentially lead to high code duplicate with other project.

@davidzollo
Copy link
Contributor Author

Is this PR generating by AI? This could potentially lead to high code duplicate with other project.

At first, I use cursor generate PR code, but there're many errors it generated, so I have to update a lot to solve this issue.

@apache apache deleted a comment from sonarqubecloud bot Feb 18, 2025
@davidzollo
Copy link
Contributor Author

@ruanwenjun Thanks for the review, I have updated the PR, please help review it when you're free, thx

@ruanwenjun
Copy link
Member

@ruanwenjun Thanks for the review, I have updated the PR, please help review it when you're free, thx

It's better to remove the extra code in #17005 (comment)

@davidzollo
Copy link
Contributor Author

@ruanwenjun Thanks for the review, I have updated the PR, please help review it when you're free, thx

It's better to remove the extra code in #17005 (comment)

Thanks for the suggestion, I have removed this logic, please help review it when you're free, thx

boolean killed = ProcessUtils.kill(taskRequest);
if (killed) {
log.info("Process tree for task: {} is killed or already finished, pid: {}",
taskRequest.getTaskAppId(), taskRequest.getProcessId());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TaskExecutionContext.getTaskAppId
should be avoided because it has been deprecated.
taskRequest.getTaskAppId(), taskRequest.getProcessId());
} else {
log.error("Failed to kill process tree for task: {}, pid: {}",
taskRequest.getTaskAppId(), taskRequest.getProcessId());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TaskExecutionContext.getTaskAppId
should be avoided because it has been deprecated.
@sonarqubecloud
Copy link

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@SbloodyS SbloodyS merged commit ed59a90 into apache:dev Feb 23, 2025
71 checks passed
LeonYoah added a commit to LeonYoah/dolphinscheduler that referenced this pull request Nov 1, 2025
…hod (apache#17005)

   [Fix-17316][Task-API] Add check process status after killing task (apache#17320)
   [Fix-17436][Workflow]Task timeout kill throw exception (apache#17437  改造支持seatunnel集群模式停止任务
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [dolphinscheduler-task-plugin] Fix process termination logic in AbstractCommandExecutor.cancelApplication

3 participants