Skip to content

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 2c5162a commit b1812a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etcdserver/api/rafthttp/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,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 b1812a4

Please sign in to comment.