summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-11-23 13:28:39 -0500
committerGitHub <noreply@github.com>2021-11-23 13:28:39 -0500
commit3482f3f32d773c09aacbbf4f8b1a8d1647021882 (patch)
tree9f150a7a6b34e1b2ad0c54072e4708872097a364
parentb2d4d62c131dd3a98ffaa7cc416b4216439a8b40 (diff)
parent5cf2683bfef7f15aaccc6f2321fb1e63dbf3f18a (diff)
downloadpodman-3482f3f32d773c09aacbbf4f8b1a8d1647021882.tar.gz
podman-3482f3f32d773c09aacbbf4f8b1a8d1647021882.tar.bz2
podman-3482f3f32d773c09aacbbf4f8b1a8d1647021882.zip
Merge pull request #12397 from mheon/warn_on_failed_update
Warn on failing to update container status
-rw-r--r--libpod/oci_conmon_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index ea6facfa6..baf05189c 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -407,8 +407,11 @@ func (r *ConmonOCIRuntime) KillContainer(ctr *Container, signal uint, all bool)
args = append(args, "kill", ctr.ID(), fmt.Sprintf("%d", signal))
}
if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, env, r.path, args...); err != nil {
- // try updating container state but ignore errors we cant do anything if this fails.
- r.UpdateContainerStatus(ctr)
+ // Update container state - there's a chance we failed because
+ // the container exited in the meantime.
+ if err2 := r.UpdateContainerStatus(ctr); err2 != nil {
+ logrus.Infof("Error updating status for container %s: %v", ctr.ID(), err2)
+ }
if ctr.state.State == define.ContainerStateExited {
return nil
}