summaryrefslogtreecommitdiff
path: root/libpod/define/containerstate.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-01-07 13:13:36 +0100
committerValentin Rothberg <rothberg@redhat.com>2021-01-14 17:45:30 +0100
commitd54478d8eaec9481d482942b87065af36995d39a (patch)
tree6c18acf17797a234b3c3f5e95f6e50b71a5d5b1b /libpod/define/containerstate.go
parentd2503ae99b773db7b9dbdf3abf3be0160ac78399 (diff)
downloadpodman-d54478d8eaec9481d482942b87065af36995d39a.tar.gz
podman-d54478d8eaec9481d482942b87065af36995d39a.tar.bz2
podman-d54478d8eaec9481d482942b87065af36995d39a.zip
container stop: release lock before calling the runtime
Podman defers stopping the container to the runtime, which can take some time. Keeping the lock while waiting for the runtime to complete the stop procedure, prevents other commands from acquiring the lock as shown in #8501. To improve the user experience, release the lock before invoking the runtime, and re-acquire the lock when the runtime is finished. Also introduce an intermediate "stopping" to properly distinguish from "stopped" containers etc. Fixes: #8501 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod/define/containerstate.go')
-rw-r--r--libpod/define/containerstate.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/define/containerstate.go b/libpod/define/containerstate.go
index 825e77387..5d2bc9099 100644
--- a/libpod/define/containerstate.go
+++ b/libpod/define/containerstate.go
@@ -28,6 +28,9 @@ const (
// ContainerStateRemoving indicates the container is in the process of
// being removed.
ContainerStateRemoving ContainerStatus = iota
+ // ContainerStateStopping indicates the container is in the process of
+ // being stopped.
+ ContainerStateStopping ContainerStatus = iota
)
// ContainerStatus returns a string representation for users
@@ -50,6 +53,8 @@ func (t ContainerStatus) String() string {
return "exited"
case ContainerStateRemoving:
return "removing"
+ case ContainerStateStopping:
+ return "stopping"
}
return "bad state"
}