From 4f56964d556a7379c09a903258fd44c2232a686a Mon Sep 17 00:00:00 2001 From: Marco Vedovati Date: Mon, 17 Jun 2019 15:14:54 +0200 Subject: 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 --- libpod/container_attach_unsupported.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libpod/container_attach_unsupported.go') 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 } -- cgit v1.2.3-54-g00ecf