Browse Source

consensus: avoid panic during shutdown

pull/8170/head
tycho garen 2 years ago
parent
commit
b4c295ed84
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      internal/consensus/state.go

+ 6
- 0
internal/consensus/state.go View File

@ -874,6 +874,12 @@ func (cs *State) receiveRoutine(ctx context.Context, maxSteps int) {
if err, ok := r.(error); ok && errors.Is(err, autofile.ErrAutoFileClosed) {
return
}
// don't re-panic if we're already trying to
// shut down
if ctx.Err() != nil {
return
}
panic(r)
}
}()


Loading…
Cancel
Save