Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit bdc41ee

Browse files
authored
Merge pull request #62 from redpanda-data/td-kgo-leave-group
Repeater should leave CG on graceful shutdown
2 parents 1b80376 + 2c38d85 commit bdc41ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/kgo-repeater/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"os/signal"
1414
"runtime/pprof"
1515
"strings"
16+
"syscall"
1617
"time"
1718

1819
log "github.com/sirupsen/logrus"
@@ -127,7 +128,7 @@ func main() {
127128
}
128129

129130
c := make(chan os.Signal, 1)
130-
signal.Notify(c, os.Interrupt)
131+
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
131132

132133
var verifiers []*repeater.Worker
133134

@@ -171,6 +172,12 @@ func main() {
171172
log.Infof("Waiting for worker %d complete", i)
172173
log.Infof("Verifier %d result: %s", i, result.String())
173174
}
175+
176+
for i, v := range verifiers {
177+
log.Infof("Shutting down worker %d...", i)
178+
(*v).Shutdown()
179+
log.Infof("Worker %d shutdown complete", i)
180+
}
174181
}
175182

176183
// Even if we're not in remote mode, start the HTTP listener so

0 commit comments

Comments
 (0)