Skip to content

Commit

Permalink
Merge pull request #62 from redpanda-data/td-kgo-leave-group
Browse files Browse the repository at this point in the history
Repeater should leave CG on graceful shutdown
  • Loading branch information
travisdowns authored Dec 9, 2024
2 parents 1b80376 + 2c38d85 commit bdc41ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/kgo-repeater/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os/signal"
"runtime/pprof"
"strings"
"syscall"
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -127,7 +128,7 @@ func main() {
}

c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)

var verifiers []*repeater.Worker

Expand Down Expand Up @@ -171,6 +172,12 @@ func main() {
log.Infof("Waiting for worker %d complete", i)
log.Infof("Verifier %d result: %s", i, result.String())
}

for i, v := range verifiers {
log.Infof("Shutting down worker %d...", i)
(*v).Shutdown()
log.Infof("Worker %d shutdown complete", i)
}
}

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

0 comments on commit bdc41ee

Please sign in to comment.