Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Raft HTTP: fix pause/resume race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
yznima committed Jun 17, 2019
1 parent 6c369d1 commit 9ce26f4
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 9ce26f4

Please sign in to comment.