From 3d1a3ecaecc52aad94f54fd7d59ab9abdfa2bc78 Mon Sep 17 00:00:00 2001 From: Benedikt Radtke Date: Sat, 4 Oct 2025 01:20:59 +0200 Subject: [PATCH] Write error to watcher error channel if Start() fails Up's loop will notice globalCtx is done, and invoke watcher.Stop(). Stop() reads from the watcher error channel. If Start() does not write an error, Stop() will never finish. Fixes https://github.com/docker/compose/issues/13262 Signed-off-by: Benedikt Radtke --- pkg/compose/watch.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compose/watch.go b/pkg/compose/watch.go index 192e8c911cf..644a4dced98 100644 --- a/pkg/compose/watch.go +++ b/pkg/compose/watch.go @@ -89,6 +89,9 @@ func (w *Watcher) Start(ctx context.Context) error { w.stopFn = cancelFunc wait, err := w.watchFn(ctx, w.project, w.options) if err != nil { + go func() { + w.errCh <- err + }() return err } go func() {