Merge pull request #4094 from heyitsanthony/send-merged-done-nowait

etcdserver: respect done channel when sleeping for snapshot backoff
This commit is contained in:
Anthony Romano 2015-12-29 20:18:08 -08:00
commit 8346a7c052

View File

@ -933,7 +933,10 @@ func (s *EtcdServer) sendMergedSnap(merged snap.Message) {
// If the follower still fails to catch up, it is probably just too slow
// to catch up. We cannot avoid the snapshot cycle anyway.
if ok {
time.Sleep(releaseDelayAfterSnapshot)
select {
case <-time.After(releaseDelayAfterSnapshot):
case <-s.done:
}
}
atomic.AddInt64(&s.inflightSnapshots, -1)
case <-s.done: