Skip to content

Commit

Permalink
Possible fix for failed to get state for index moby#3635
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Voronkov <[email protected]>
  • Loading branch information
Antiarchitect committed Feb 20, 2023
1 parent 37d54eb commit 6826b3a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions solver/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,17 +733,16 @@ func (s *sharedOp) CalcSlowCache(ctx context.Context, index Index, p PreprocessF
complete := true
if p != nil {
st := s.st.solver.getState(s.st.vtx.Inputs()[index])
if st == nil {
return nil, errors.Errorf("failed to get state for index %d on %v", index, s.st.vtx.Name())
}
ctx2 := progress.WithProgress(ctx, st.mpw)
if st.mspan.Span != nil {
ctx2 = trace.ContextWithSpan(ctx2, st.mspan)
}
err = p(ctx2, res, st)
if err != nil {
f = nil
ctx = ctx2
if st != nil {
ctx2 := progress.WithProgress(ctx, st.mpw)
if st.mspan.Span != nil {
ctx2 = trace.ContextWithSpan(ctx2, st.mspan)
}
err = p(ctx2, res, st)
if err != nil {
f = nil
ctx = ctx2
}
}
}

Expand Down

0 comments on commit 6826b3a

Please sign in to comment.