Skip to content

Commit

Permalink
Merge pull request #3774 from tonistiigi/v0.11-fileopsolver-unique
Browse files Browse the repository at this point in the history
[v0.11] fileop: create new fileOpSolver instance per Exec call
  • Loading branch information
crazy-max authored Apr 7, 2023
2 parents 08941b1 + a1ae2bd commit 664059a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions solver/llbsolver/ops/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ const fileCacheType = "buildkit.file.v0"

type fileOp struct {
op *pb.FileOp
md cache.MetadataStore
w worker.Worker
solver *FileOpSolver
refManager *file.RefManager
numInputs int
parallelism *semaphore.Weighted
}
Expand All @@ -41,12 +40,12 @@ func NewFileOp(v solver.Vertex, op *pb.Op_File, cm cache.Manager, parallelism *s
if err := opsutils.Validate(&pb.Op{Op: op}); err != nil {
return nil, err
}
refManager := file.NewRefManager(cm, v.Name())
return &fileOp{
op: op.File,
md: cm,
numInputs: len(v.Inputs()),
w: w,
solver: NewFileOpSolver(w, &file.Backend{}, file.NewRefManager(cm, v.Name())),
refManager: refManager,
numInputs: len(v.Inputs()),
parallelism: parallelism,
}, nil
}
Expand Down Expand Up @@ -168,7 +167,8 @@ func (f *fileOp) Exec(ctx context.Context, g session.Group, inputs []solver.Resu
inpRefs = append(inpRefs, workerRef.ImmutableRef)
}

outs, err := f.solver.Solve(ctx, inpRefs, f.op.Actions, g)
fs := NewFileOpSolver(f.w, &file.Backend{}, f.refManager)
outs, err := fs.Solve(ctx, inpRefs, f.op.Actions, g)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 664059a

Please sign in to comment.