mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Raft HTTP: fix pause/resume race condition
(cherry picked from commit b1812a410fbca6fb77bf95b496408c7b75d0a370)
This commit is contained in:
parent
5832014353
commit
9f1d6ca1c9
@ -372,12 +372,16 @@ type Pausable interface {
|
||||
}
|
||||
|
||||
func (t *Transport) Pause() {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
for _, p := range t.peers {
|
||||
p.(Pausable).Pause()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Transport) Resume() {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
for _, p := range t.peers {
|
||||
p.(Pausable).Resume()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user