Selaa lähdekoodia

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

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
Ziheng Liu 5 vuotta sitten
vanhempi
commit
6233217a31
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      integration/internal/container/exec.go

+ 1 - 1
integration/internal/container/exec.go

@@ -57,7 +57,7 @@ func Exec(ctx context.Context, cli client.APIClient, id string, cmd []string) (E
 
 
 	// read the output
 	// read the output
 	var outBuf, errBuf bytes.Buffer
 	var outBuf, errBuf bytes.Buffer
-	outputDone := make(chan error)
+	outputDone := make(chan error, 1)
 
 
 	go func() {
 	go func() {
 		// StdCopy demultiplexes the stream into two buffers
 		// StdCopy demultiplexes the stream into two buffers