Skip to content

Commit

Permalink
Merge pull request moby#4592 from jedevc/close-solver
Browse files Browse the repository at this point in the history
chore: close solver resources on shutdown
  • Loading branch information
tonistiigi authored Jan 26, 2024
2 parents 6bd8137 + 6337e81 commit 23b9dd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ func (c *Controller) Close() error {
if err := c.opt.WorkerController.Close(); err != nil {
rerr = multierror.Append(rerr, err)
}

if err := c.opt.CacheStore.Close(); err != nil {
rerr = multierror.Append(rerr, err)
}

if err := c.solver.Close(); err != nil {
rerr = multierror.Append(rerr, err)
}
return rerr
}

Expand Down
6 changes: 6 additions & 0 deletions solver/llbsolver/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ func New(opt Opt) (*Solver, error) {
return s, nil
}

func (s *Solver) Close() error {
s.solver.Close()
err := s.sysSampler.Close()
return err
}

func (s *Solver) resolver() solver.ResolveOpFunc {
return func(v solver.Vertex, b solver.Builder) (solver.Op, error) {
w, err := s.resolveWorker()
Expand Down

0 comments on commit 23b9dd8

Please sign in to comment.