Fix: Use SIGKILL instead of SIGTERM when ExecStopContainer timeout is 0

Aligns behavior with documentation stating SIGKILL should be sent immediately if the timeout is zero.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák 2025-05-12 12:47:27 +02:00
parent 499ea1168b
commit 077649f9d0
No known key found for this signature in database
GPG Key ID: D458A9B20435C2BF
1 changed files with 1 additions and 1 deletions

View File

@ -258,7 +258,7 @@ func (r *ConmonOCIRuntime) ExecStopContainer(ctr *Container, sessionID string, t
// SIGTERM did not work. On to SIGKILL.
logrus.Debugf("Killing exec session %s (PID %d) of container %s with SIGKILL", sessionID, pid, ctr.ID())
if err := pidHandle.Kill(unix.SIGTERM); err != nil {
if err := pidHandle.Kill(unix.SIGKILL); err != nil {
if err == unix.ESRCH {
return nil
}