Skip to content

Commit

Permalink
Merge pull request #5136 from tonistiigi/stoptrace-call-fix
Browse files Browse the repository at this point in the history
llbsolver: make sure stoptrace called on bolt error
  • Loading branch information
AkihiroSuda authored Jul 9, 2024
2 parents 486d1ef + 76945ca commit 0b1a789
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions solver/llbsolver/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
Type: controlapi.BuildHistoryEventType_STARTED,
Record: rec,
}); err != nil {
if stopTrace != nil {
stopTrace()
}
return nil, err
}

Expand Down Expand Up @@ -377,9 +380,10 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
}()

if err != nil {
status, desc, release, err := s.history.ImportError(ctx, err)
if err != nil {
return err
status, desc, release, err1 := s.history.ImportError(ctx, err)
if err1 != nil {
// don't replace the build error with this import error
bklog.G(ctx).Errorf("failed to import error to build record: %+v", err1)
}
rec.ExternalError = desc
releasers = append(releasers, release)
Expand Down

0 comments on commit 0b1a789

Please sign in to comment.