1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #41360 from lzhfromustc/GL_5

Builder: Add 1 buffer to two channels to avoid blocking goroutine
This commit is contained in:
Brian Goff 2020-09-12 21:43:05 -07:00 committed by GitHub
commit bf6f0d82bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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)
}()

View file

@ -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