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

Commit

Permalink
Fix issue with runc kill
Browse files Browse the repository at this point in the history
Converts a runc error calling kill on an already dead pid to a success
since it is the final state we wanted anyways.

Signed-off-by: Justin Terry (VM) <[email protected]>
  • Loading branch information
jterry75 committed Aug 20, 2018
1 parent 4446ff2 commit 843def1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service/gcs/runtime/runc/runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ func (c *container) Kill(signal oslayer.Signal) error {
cmd := exec.Command("runc", "--log", logPath, "kill", c.id, strconv.Itoa(int(signal)))
out, err := cmd.CombinedOutput()
if err != nil {
return errors.Wrapf(err, "runc kill failed with: %s", out)
if !strings.Contains(err.Error(), "os: process already finished") {
return errors.Wrapf(err, "runc kill failed with: %s", out)
}
}
return nil
}
Expand Down

0 comments on commit 843def1

Please sign in to comment.