etcdserver: do not block on raft stopping

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
release-3.2
Gyu-Ho Lee 2017-04-25 13:35:43 -07:00
parent 2af1605db3
commit 327f09fcb4
1 changed files with 5 additions and 1 deletions

View File

@ -260,7 +260,11 @@ func (r *raftNode) start(rh *raftReadyHandler) {
// blocks until 'applyAll' calls 'applyWait.Trigger'
// to be in sync with scheduled config-change job
// (assume raftDone has cap of 1)
raftDone <- struct{}{}
select {
case raftDone <- struct{}{}:
case <-r.stopped:
return
}
}
// gofail: var raftBeforeFollowerSend struct{}