Skip to content

Commit

Permalink
Merge pull request #10827 from yznima/pr-race-3.3
Browse files Browse the repository at this point in the history
Raft HTTP: fix pause/resume race condition
  • Loading branch information
gyuho authored Jul 23, 2019
2 parents 5832014 + 9f1d6ca commit d12f132
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rafthttp/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit d12f132

Please sign in to comment.