Browse code

integration/internal/container: fix a goroutine leak bug by adding 1 buffer

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>

Ziheng Liu authored on 2019/10/28 09:22:52
Showing 1 changed files
... ...
@@ -57,7 +57,7 @@ func Exec(ctx context.Context, cli client.APIClient, id string, cmd []string) (E
57 57
 
58 58
 	// read the output
59 59
 	var outBuf, errBuf bytes.Buffer
60
-	outputDone := make(chan error)
60
+	outputDone := make(chan error, 1)
61 61
 
62 62
 	go func() {
63 63
 		// StdCopy demultiplexes the stream into two buffers