From b853c78c3518fe5b0697a66b99ed03fdd192003d Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Fri, 9 Oct 2026 13:18:03 -0500 Subject: [PATCH] fix(solver): check for context canceled in ReleaseUnreferenced The existing implementations do not check for the context being canceled when `ReleaseUnreferenced` is called which has caused a bug in how the controller invokes `ReleaseUnreferenced` to be uncaught. We pass an already canceled context to the method which causes any implementations that do check the context to always fail. Signed-off-by: Jonathan A. Sternberg --- control/control.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/control/control.go b/control/control.go index 78adaadd8..594c2c03b 100644 --- a/control/control.go +++ b/control/control.go @@ -245,7 +245,8 @@ func (c *Controller) Prune(req *controlapi.PruneRequest, stream controlapi.Contr ch := make(chan client.UsageInfo, 32) - eg, ctx := errgroup.WithContext(stream.Context()) + ctx := stream.Context() + eg, ectx := errgroup.WithContext(ctx) workers, err := c.opt.WorkerController.List() if err != nil { return errors.Wrap(err, "failed to list workers for prune") @@ -267,7 +268,7 @@ func (c *Controller) Prune(req *controlapi.PruneRequest, stream controlapi.Contr for _, w := range workers { func(w worker.Worker) { eg.Go(func() error { - return w.Prune(ctx, ch, client.PruneInfo{ + return w.Prune(ectx, ch, client.PruneInfo{ Filter: req.Filter, All: req.All, KeepDuration: time.Duration(req.KeepDuration),