From 10461278b6b22785657ec3b6e9b7987d60f13eee Mon Sep 17 00:00:00 2001 From: allencloud Date: Wed, 27 Apr 2016 16:48:21 +0800 Subject: [PATCH] close http response body when attaching Signed-off-by: allencloud Upstream-commit: 54d09c6c2d5413f7a05c8a1bc4011298d93979e3 Component: engine --- components/engine/api/client/run.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/engine/api/client/run.go b/components/engine/api/client/run.go index 4b66c8c2a8..f0db9bf8b1 100644 --- a/components/engine/api/client/run.go +++ b/components/engine/api/client/run.go @@ -212,6 +212,8 @@ func (cli *DockerCli) CmdRun(args ...string) error { // keep the error and read detailed error message from hijacked connection later return errAttach } + defer resp.Close() + ctx, cancelFun = context.WithCancel(context.Background()) errCh = promise.Go(func() error { errHijack := cli.holdHijackedConnection(ctx, config.Tty, in, out, stderr, resp)