From 7d3616474d1e04e673a3fe5fab8e1c753a9e4884 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 12 Apr 2024 22:08:36 +0200 Subject: [PATCH] Revert change to allow trying to kill again if a kill fails Signed-off-by: Jaime Soriano Pastor --- pkg/compose/up.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/compose/up.go b/pkg/compose/up.go index d3a18a59..a657e168 100644 --- a/pkg/compose/up.go +++ b/pkg/compose/up.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "os/signal" - "sync/atomic" "syscall" "github.com/compose-spec/compose-go/v2/types" @@ -109,8 +108,6 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options } } - // killRunning is used to control that we don't run more than one kill if signals are spammed. - var killRunning atomic.Bool for { select { case <-doneCh: @@ -124,13 +121,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options gracefulTeardown() break } - if !killRunning.CompareAndSwap(false, true) { - break - } eg.Go(func() error { - defer killRunning.Store(false) - // Intentionally ignore errors, for cases where some - // of the containers are already stopped. err := s.kill(context.Background(), project.Name, api.KillOptions{ Services: options.Create.Services, Project: project, @@ -143,6 +134,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options return err }) + return nil case event := <-kEvents: formatter.KeyboardManager.HandleKeyEvents(event, ctx, project, options) }