Просмотр исходного кода

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 <[email protected]>
Benedikt Radtke 3 месяцев назад
Родитель
Сommit
fa7e85ed83
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      pkg/compose/watch.go

+ 3 - 0
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() {