Skip to content

Commit

Permalink
Merge pull request moby#41360 from lzhfromustc/GL_5
Browse files Browse the repository at this point in the history
Builder: Add 1 buffer to two channels to avoid blocking goroutine
  • Loading branch information
cpuguy83 committed Sep 13, 2020
2 parents c036d26 + d1c2f95 commit bf6f0d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builder/dockerfile/containerbackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()
Expand Down
2 changes: 1 addition & 1 deletion integration/plugin/logging/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf6f0d8

Please sign in to comment.