mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4094 from heyitsanthony/send-merged-done-nowait
etcdserver: respect done channel when sleeping for snapshot backoff
This commit is contained in:
commit
8346a7c052
@ -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
|
// If the follower still fails to catch up, it is probably just too slow
|
||||||
// to catch up. We cannot avoid the snapshot cycle anyway.
|
// to catch up. We cannot avoid the snapshot cycle anyway.
|
||||||
if ok {
|
if ok {
|
||||||
time.Sleep(releaseDelayAfterSnapshot)
|
select {
|
||||||
|
case <-time.After(releaseDelayAfterSnapshot):
|
||||||
|
case <-s.done:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
atomic.AddInt64(&s.inflightSnapshots, -1)
|
atomic.AddInt64(&s.inflightSnapshots, -1)
|
||||||
case <-s.done:
|
case <-s.done:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user