Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
shimv2: Merge pull request #1494 from lifupan/fixstop
Browse files Browse the repository at this point in the history
shimv2: fix the issue of stop container failed
(cherry picked from commit c08976e)

Fixes:#1493

Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
  • Loading branch information
Julio Montes authored and Ganesh Maharaj Mahalingam committed Apr 16, 2019
1 parent 0b7c329 commit 732cfc2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,19 +647,7 @@ func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (*ptypes.Emp
processID = execs.id
}

err = s.sandbox.SignalProcess(c.id, processID, signum, r.All)
if err != nil {
return nil, err
}

// Since the k8s will use the SIGTERM signal to stop a container by default, but
// some container processes would ignore this signal such as shell, thus it's better
// to resend another SIGKILL signal to make sure the container process terminated successfully.
if signum == syscall.SIGTERM {
err = s.sandbox.SignalProcess(c.id, processID, syscall.SIGKILL, r.All)
}

return empty, err
return empty, s.sandbox.SignalProcess(c.id, processID, signum, r.All)
}

// Pids returns all pids inside the container
Expand Down

0 comments on commit 732cfc2

Please sign in to comment.