Skip to content

Commit a06809b

Browse files
authored
Stop gpbft runner on shutdown (#428)
1 parent 3b6ea9e commit a06809b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

f3.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,16 @@ func (m *F3) Start(startCtx context.Context) (_err error) {
185185
pendingManifest = nil
186186
}
187187

188-
m.errgrp.Go(func() error {
188+
m.errgrp.Go(func() (_err error) {
189+
defer func() {
190+
m.mu.Lock()
191+
defer m.mu.Unlock()
192+
if m.runner != nil {
193+
_err = multierr.Append(_err, m.runner.Stop(context.Background()))
194+
m.runner = nil
195+
}
196+
}()
197+
189198
manifestChangeTimer := time.NewTimer(initialDelay)
190199
if pendingManifest == nil && !manifestChangeTimer.Stop() {
191200
<-manifestChangeTimer.C

0 commit comments

Comments
 (0)