summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-08-26 10:42:34 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-08-26 12:39:43 +0200
commit15aeccb8341d44510b3ec055678f010a2624b34e (patch)
tree640887649e221c0c6cd6b488b4514c14166f778d /libpod
parent36cf6f572a360af91bf261936b6ed6849f355478 (diff)
downloadpodman-15aeccb8341d44510b3ec055678f010a2624b34e.tar.gz
podman-15aeccb8341d44510b3ec055678f010a2624b34e.tar.bz2
podman-15aeccb8341d44510b3ec055678f010a2624b34e.zip
libpod: UpdateContainerStatus: do not wait for container
Commit 30e7cbccc194 accidentally added a deadlock as Podman was waiting for the exit code to show up when the container transitioned to stopped. Code paths that require the exit code to be written (by the cleanup process) should already be using `(*Container).Wait()` in a deadlock free way. [NO NEW TESTS NEEDED] as I did not manage to a reproducer that would work in CI. Ultimately, it's a race condition. Fixes: #15492 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_conmon_common.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/libpod/oci_conmon_common.go b/libpod/oci_conmon_common.go
index c3725cdb4..b96f92d3a 100644
--- a/libpod/oci_conmon_common.go
+++ b/libpod/oci_conmon_common.go
@@ -277,15 +277,6 @@ func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container) error {
ctr.ID(), state.Status, define.ErrInternal)
}
- // Only grab exit status if we were not already stopped
- // If we were, it should already be in the database
- if ctr.state.State == define.ContainerStateStopped && oldState != define.ContainerStateStopped {
- if _, err := ctr.Wait(context.Background()); err != nil {
- logrus.Errorf("Waiting for container %s to exit: %v", ctr.ID(), err)
- }
- return nil
- }
-
// Handle ContainerStateStopping - keep it unless the container
// transitioned to no longer running.
if oldState == define.ContainerStateStopping && (ctr.state.State == define.ContainerStatePaused || ctr.state.State == define.ContainerStateRunning) {