Merge pull request #41360 from lzhfromustc/GL_5
Builder: Add 1 buffer to two channels to avoid blocking goroutine
This commit is contained in:
commit
bf6f0d82bc
2 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,7 @@ var errCancelled = errors.New("build cancelled")
|
|||
// Run a container by ID
|
||||
func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) (err error) {
|
||||
attached := make(chan struct{})
|
||||
errCh := make(chan error)
|
||||
errCh := make(chan error, 1)
|
||||
go func() {
|
||||
errCh <- c.backend.ContainerAttachRaw(cID, nil, stdout, stderr, true, attached)
|
||||
}()
|
||||
|
|
|
@ -73,7 +73,7 @@ func TestReadPluginNoRead(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
errCh := make(chan error)
|
||||
errCh := make(chan error, 1)
|
||||
go func() {
|
||||
_, err := stdcopy.StdCopy(buf, buf, logs)
|
||||
errCh <- err
|
||||
|
|
Loading…
Reference in a new issue