Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix deadlock on handling deps errors #962

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,15 +859,13 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do

c := clients[dp.driverIndex]
eg.Go(func() error {
pw = progress.ResetTime(pw)
defer wg.Done()

if err := waitContextDeps(ctx, dp.driverIndex, results, &so); err != nil {
return err
}

pw = progress.ResetTime(pw)
defer wg.Done()
ch, done := progress.NewChannel(pw)
defer func() { <-done }()

frontendInputs := make(map[string]*pb.Definition)
for key, st := range so.FrontendInputs {
def, err := st.Marshal(ctx)
Expand All @@ -886,6 +884,9 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do
so.FrontendAttrs = nil
so.FrontendInputs = nil

ch, done := progress.NewChannel(pw)
defer func() { <-done }()

rr, err := c.Build(ctx, so, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) {
res, err := c.Solve(ctx, req)
if err != nil {
Expand Down