summaryrefslogtreecommitdiff
path: root/daemon/attach.go
diff options
context:
space:
mode:
authorBrian Goff <cpuguy83@gmail.com>2018-05-31 10:01:27 -0400
committerBrian Goff <cpuguy83@gmail.com>2018-05-31 10:11:18 -0400
commit0f5147701775a6c5d4980a7b7c0ed2e830688034 (patch)
tree66df4be69329cc4c70091a9bf592ef7280755f4f /daemon/attach.go
parentb85799b63fb25423620ed16e717a99401cd3a39b (diff)
downloaddocker-0f5147701775a6c5d4980a7b7c0ed2e830688034.tar.gz
Fix fd leak on attach
With a full attach, each attach was leaking 4 goroutines. This updates attach to use errgroup instead of the hodge-podge of waitgroups and channels. In addition, the detach event was never being sent. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Diffstat (limited to 'daemon/attach.go')
-rw-r--r--daemon/attach.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/attach.go b/daemon/attach.go
index 21ed9a06b7..fb14691d24 100644
--- a/daemon/attach.go
+++ b/daemon/attach.go
@@ -176,7 +176,7 @@ func (daemon *Daemon) containerAttach(c *container.Container, cfg *stream.Attach
ctx := c.InitAttachContext()
err := <-c.StreamConfig.CopyStreams(ctx, cfg)
if err != nil {
- if _, ok := err.(term.EscapeError); ok {
+ if _, ok := errors.Cause(err).(term.EscapeError); ok || err == context.Canceled {
daemon.LogContainerEvent(c, "detach")
} else {
logrus.Errorf("attach failed with error: %v", err)