From d7f8b4d43eda7453fcae20f879abe10b9985a127 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 31 Aug 2015 14:24:05 -0700 Subject: [PATCH] Fix goroutine leak on pull Close the pipeWriter even if there was no error. Signed-off-by: Tonis Tiigi --- graph/pull_v2.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graph/pull_v2.go b/graph/pull_v2.go index c50507cedf..1dbb9fe3f4 100644 --- a/graph/pull_v2.go +++ b/graph/pull_v2.go @@ -235,6 +235,9 @@ func (p *v2Puller) pullV2Tag(tag, taggedName string) (verified bool, err error) // set the error. All successive reads/writes will return with this // error. pipeWriter.CloseWithError(errors.New("download canceled")) + } else { + // If no error then just close the pipe. + pipeWriter.Close() } }()