HomminLee opened a new issue, #18388:
URL: https://github.com/apache/dolphinscheduler/issues/18388

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) 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?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to