raft/autopilot: fix panic during autopilot shutdown (#27726)

* raft/autopilot: fix panic during autopilot shutdown

* changelog
This commit is contained in:
Jason O'Donnell 2024-07-09 12:52:40 -04:00 committed by GitHub
parent 0dc041625e
commit 2a09bd47ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

3
changelog/27726.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:bug
raft/autopilot: Fixed panic that may occur during shutdown
```

View file

@ -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()
}