Skip to content

Commit

Permalink
history: fix logs and traces are saving on canceled builds
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
(cherry picked from commit 9e325b9)
  • Loading branch information
tonistiigi committed Jan 25, 2023
1 parent 26ef916 commit 4659194
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions solver/llbsolver/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
}
}

ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()

var mu sync.Mutex
ch := make(chan *client.SolveStatus)
eg, ctx2 := errgroup.WithContext(ctx)
Expand Down Expand Up @@ -334,10 +337,6 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
}
}

if err != nil {
return err
}

if stopTrace == nil {
logrus.Warn("no trace recorder found, skipping")
return err
Expand Down

0 comments on commit 4659194

Please sign in to comment.