Skip to content

Commit 7d36164

Browse files
jsorianondeloof
authored andcommitted
Revert change to allow trying to kill again if a kill fails
Signed-off-by: Jaime Soriano Pastor <[email protected]>
1 parent 6a3501f commit 7d36164

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pkg/compose/up.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"os"
2323
"os/signal"
24-
"sync/atomic"
2524
"syscall"
2625

2726
"github.com/compose-spec/compose-go/v2/types"
@@ -109,8 +108,6 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
109108
}
110109
}
111110

112-
// killRunning is used to control that we don't run more than one kill if signals are spammed.
113-
var killRunning atomic.Bool
114111
for {
115112
select {
116113
case <-doneCh:
@@ -124,13 +121,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
124121
gracefulTeardown()
125122
break
126123
}
127-
if !killRunning.CompareAndSwap(false, true) {
128-
break
129-
}
130124
eg.Go(func() error {
131-
defer killRunning.Store(false)
132-
// Intentionally ignore errors, for cases where some
133-
// of the containers are already stopped.
134125
err := s.kill(context.Background(), project.Name, api.KillOptions{
135126
Services: options.Create.Services,
136127
Project: project,
@@ -143,6 +134,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
143134

144135
return err
145136
})
137+
return nil
146138
case event := <-kEvents:
147139
formatter.KeyboardManager.HandleKeyEvents(event, ctx, project, options)
148140
}

0 commit comments

Comments
 (0)