Browse Source

narrow panics

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

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

@ -875,9 +875,9 @@ func (cs *State) receiveRoutine(ctx context.Context, maxSteps int) {
return
}
// don't re-panic if we're already trying to
// shut down
if ctx.Err() != nil {
// don't re-panic if the panic is just an
// error and we're already trying to shut down
if _, ok := r.(error); ok && ctx.Err() != nil {
return
}
panic(r)
@ -909,9 +909,9 @@ func (cs *State) receiveRoutine(ctx context.Context, maxSteps int) {
case mi := <-cs.internalMsgQueue:
err := cs.wal.WriteSync(mi) // NOTE: fsync
if err != nil {
panic(fmt.Errorf(
"failed to write %v msg to consensus WAL due to %w; check your file system and restart the node",
mi, err,
panic(fmt.Sprintf(
"failed to write %v msg to consensus WAL due to %q; check your file system and restart the node",
mi, err.Error(),
))
}


Loading…
Cancel
Save