From a467a1c10f1f7c556862a8aec6217119d5079233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20B=C3=B6hne?= Date: Wed, 7 Feb 2024 08:45:19 +0100 Subject: [PATCH] fix: race condition on stopping containers --- pkg/service/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/service/service.go b/pkg/service/service.go index 6a94f17..4f8ab2e 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -203,7 +203,9 @@ func (s *Core) stopDependenciesFor(ctx context.Context, cid string, cts *Contain for _, ct := range containers { if ct.IsRunning() { logrus.Infof("Stopping %s...", ct.NameID()) - go s.client.ContainerStop(ctx, ct.ID, container.StopOptions{}) + if err := s.client.ContainerStop(ctx, ct.ID, container.StopOptions{}); err != nil { + logrus.Warnf("Error stopping %s: %v", ct.NameID(), err) + } } } }