Skip to content

[Improvement] [Task] Killed shell tasks may be displayed as FAILURE #18388

Description

@HomminLee

Search before asking

  • I had searched in the issues and found no similar issues.

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

backendimprovementmake more easy to user or prompt friendly

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions