njnu-seafish commented on code in PR #17320:
URL:
https://github.com/apache/dolphinscheduler/pull/17320#discussion_r2197084167
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ProcessUtils.java:
##########
@@ -144,18 +156,54 @@ public static boolean kill(@NonNull TaskExecutionContext
request) {
*/
private static boolean sendKillSignal(String signal, String pids, String
tenantCode) {
try {
+ // 1. Send the kill signal
String killCmd = String.format("kill -s %s %s", signal, pids);
killCmd = OSUtils.getSudoCmd(tenantCode, killCmd);
log.info("Sending {} to process group: {}, command: {}", signal,
pids, killCmd);
OSUtils.exeCmd(killCmd);
+ // 2. Wait for the process to respond to the signal
+ ThreadUtils.sleep(SLEEP_TIME_MILLIS * PROCESS_STATUS_CHECK_DELAY);
Review Comment:
Thank you so much for your suggestions! I've made revisions based on your
input. Could you kindly review it again? Thanks a lot!
--
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]