Merge pull request #10827 from yznima/pr-race-3.3

Raft HTTP: fix pause/resume race condition
This commit is contained in:
Gyuho Lee 2019-07-23 10:59:02 -07:00 committed by GitHub
commit d12f13279f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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