From 3037e4f7c4eec06cf3a5afca6f58ec58b4bdd63e 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 96f47b873a..116fee77c5 100644 --- a/graph/pull_v2.go +++ b/graph/pull_v2.go @@ -230,6 +230,9 @@ func (p *v2Puller) pullV2Tag(out io.Writer, tag, taggedName string) (verified bo // 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() } }()