Search before asking
What happened
Shell tasks can be terminated in three ways, with signals -2, -9, and -15, respectively.
// 1. Try to terminate gracefully `kill -2`
boolean gracefulKillSuccess = sendKillSignal(SIGINT, pidList, request.getTenantCode());
// 2. Try to terminate gracefully `kill -15`
boolean termKillSuccess = sendKillSignal(SIGTERM, pidList, request.getTenantCode());
// 3. As a last resort, use `kill -9`
boolean forceKillSuccess = sendKillSignal(SIGKILL, pidList, request.getTenantCode());
However, the existi code only checks two termination signals in AbstractTask:
public static final int EXIT_CODE_KILL = 137;
public static final int EXIT_CODE_HARD_KILL = 143;
if (exitStatusCode == TaskConstants.EXIT_CODE_KILL || exitStatusCode == TaskConstants.EXIT_CODE_HARD_KILL) {
return TaskExecutionStatus.KILL;
}
It is missing the check for signal -2, whose exit code is 130.
What you expected to happen
Killed shell tasks should be always displayed as KILL.
How to reproduce
start a shell task and kill it.
Anything else
No response
Version
3.4.2
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
Shell tasks can be terminated in three ways, with signals -2, -9, and -15, respectively.
However, the existi code only checks two termination signals in
AbstractTask:It is missing the check for signal
-2, whose exit code is130.What you expected to happen
Killed shell tasks should be always displayed as KILL.
How to reproduce
start a shell task and kill it.
Anything else
No response
Version
3.4.2
Are you willing to submit PR?
Code of Conduct