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

Commit

Permalink
Merge pull request #4 from yznima/pr-race-appian
Browse files Browse the repository at this point in the history
Raft HTTP: fix pause/resume race condition
  • Loading branch information
jkessler93 authored Jun 17, 2019
2 parents 6c369d1 + 9ce26f4 commit c3c13d6
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 c3c13d6

Please sign in to comment.