mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft/rafttest: fix shadowed variable
This commit is contained in:
parent
4e06510280
commit
8696a1509c
@ -85,7 +85,7 @@ func (rn *raftNetwork) send(m raftpb.Message) {
|
|||||||
to = nil
|
to = nil
|
||||||
}
|
}
|
||||||
drop := rn.dropmap[conn{m.From, m.To}]
|
drop := rn.dropmap[conn{m.From, m.To}]
|
||||||
delay := rn.delaymap[conn{m.From, m.To}]
|
dl := rn.delaymap[conn{m.From, m.To}]
|
||||||
rn.mu.Unlock()
|
rn.mu.Unlock()
|
||||||
|
|
||||||
if to == nil {
|
if to == nil {
|
||||||
@ -94,9 +94,9 @@ func (rn *raftNetwork) send(m raftpb.Message) {
|
|||||||
if drop != 0 && rand.Float64() < drop {
|
if drop != 0 && rand.Float64() < drop {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// TODO: shall we delay without blocking the send call?
|
// TODO: shall we dl without blocking the send call?
|
||||||
if delay.d != 0 && rand.Float64() < delay.rate {
|
if dl.d != 0 && rand.Float64() < dl.rate {
|
||||||
rd := rand.Int63n(int64(delay.d))
|
rd := rand.Int63n(int64(dl.d))
|
||||||
time.Sleep(time.Duration(rd))
|
time.Sleep(time.Duration(rd))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user