diff --git a/changelog/27726.txt b/changelog/27726.txt new file mode 100644 index 0000000000..80f2cc850f --- /dev/null +++ b/changelog/27726.txt @@ -0,0 +1,3 @@ +```release-note:bug +raft/autopilot: Fixed panic that may occur during shutdown +``` diff --git a/physical/raft/raft_autopilot.go b/physical/raft/raft_autopilot.go index d6f8889809..6a5edf9703 100644 --- a/physical/raft/raft_autopilot.go +++ b/physical/raft/raft_autopilot.go @@ -636,7 +636,8 @@ func (b *RaftBackend) StopAutopilot() { if b.autopilot == nil { return } - b.autopilot.Stop() + stopCh := b.autopilot.Stop() + <-stopCh b.autopilot = nil b.followerHeartbeatTicker.Stop() }