diff options
author | Brian Goff <cpuguy83@gmail.com> | 2018-05-31 10:01:27 -0400 |
---|---|---|
committer | Brian Goff <cpuguy83@gmail.com> | 2018-05-31 10:11:18 -0400 |
commit | 0f5147701775a6c5d4980a7b7c0ed2e830688034 (patch) | |
tree | 66df4be69329cc4c70091a9bf592ef7280755f4f /daemon/attach.go | |
parent | b85799b63fb25423620ed16e717a99401cd3a39b (diff) | |
download | docker-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.go | 2 |
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) |