diff --git a/internal/consensus/state.go b/internal/consensus/state.go index bd79f4f83..b8c0bd2be 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -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) } }()