From 3b31a33d59cdd5ea397e3d11d26941690bdc4a67 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 17 Feb 2025 20:59:48 -0800 Subject: [PATCH] progress: fix race on pausing progress on debug shell Current progress writer has a logic of pausing/unpausing the printer and internally recreating internal channels. This conflicts with a change that added sync.Once to Wait to allow it being called multiple times without erroring. In debug shell this could mean that new progress printer showed up in debug shell because it was not closed. Signed-off-by: Tonis Tiigi --- util/progress/printer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/util/progress/printer.go b/util/progress/printer.go index 95fb680d..bb3f347d 100644 --- a/util/progress/printer.go +++ b/util/progress/printer.go @@ -122,6 +122,7 @@ func NewPrinter(ctx context.Context, out console.File, mode progressui.DisplayMo for { pw.status = make(chan *client.SolveStatus) pw.done = make(chan struct{}) + pw.closeOnce = sync.Once{} pw.logMu.Lock() pw.logSourceMap = map[digest.Digest]interface{}{}