summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-10-28 11:32:31 -0400
committerMatthew Heon <mheon@redhat.com>2020-10-28 11:32:31 -0400
commit2cf443fd416f5da6465068e95dc366811d112242 (patch)
tree57119e1d43d171d3f9bf2d27d6c5302d2169a5a4 /libpod/container_api.go
parent4d87306fbe06674b16f188fea187282f29c0dc58 (diff)
downloadpodman-2cf443fd416f5da6465068e95dc366811d112242.tar.gz
podman-2cf443fd416f5da6465068e95dc366811d112242.tar.bz2
podman-2cf443fd416f5da6465068e95dc366811d112242.zip
Ensure that attach ready channel does not block
We only use this channel in terminal attach, and it was not a buffered channel originally, so it would block on trying to send unless a receiver was ready. In the non-terminal case, there was no receiver, so attach blocked forever. Buffer the channel for a single bool so that it will never block, even if unused. Fixes #8154 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index aef37dd59..a9808a30e 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -249,7 +249,7 @@ func (c *Container) Attach(streams *define.AttachStreams, keys string, resize <-
// attaching, and I really do not want to do that right now.
// Send a SIGWINCH after attach succeeds so that most programs will
// redraw the screen for the new attach session.
- attachRdy := make(chan bool)
+ attachRdy := make(chan bool, 1)
if c.config.Spec.Process != nil && c.config.Spec.Process.Terminal {
go func() {
<-attachRdy