diff options
author | Marco Vedovati <mvedovati@suse.com> | 2019-06-17 15:14:54 +0200 |
---|---|---|
committer | Marco Vedovati <mvedovati@suse.com> | 2019-06-26 10:17:29 +0200 |
commit | 4f56964d556a7379c09a903258fd44c2232a686a (patch) | |
tree | 57f2be6e11e5f413122172505c1b7661bae2a5e1 /libpod/container_attach_unsupported.go | |
parent | 6e9b490f5e2c84a903e6cc86440599e3ea7c63d2 (diff) | |
download | podman-4f56964d556a7379c09a903258fd44c2232a686a.tar.gz podman-4f56964d556a7379c09a903258fd44c2232a686a.tar.bz2 podman-4f56964d556a7379c09a903258fd44c2232a686a.zip |
libpod: fix hang on container start and attach
When a container is attached upon start, the WaitGroup counter may
never be decremented if an error is raised before start, causing
the caller to hang.
Synchronize with the start & attach goroutine using a channel, to be
able to detect failures before start.
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Diffstat (limited to 'libpod/container_attach_unsupported.go')
-rw-r--r-- | libpod/container_attach_unsupported.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libpod/container_attach_unsupported.go b/libpod/container_attach_unsupported.go index 2c8718c67..c27ce0799 100644 --- a/libpod/container_attach_unsupported.go +++ b/libpod/container_attach_unsupported.go @@ -3,12 +3,10 @@ package libpod import ( - "sync" - "github.com/containers/libpod/libpod/define" "k8s.io/client-go/tools/remotecommand" ) -func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize, startContainer bool, wg *sync.WaitGroup) error { +func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize, startContainer bool, started chan bool) error { return define.ErrNotImplemented } |