mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
benchmark: change complete notifier first
Fix https://github.com/coreos/etcd/issues/4708.
This commit is contained in:
parent
e29ed898d4
commit
b8912c9fb1
@ -198,14 +198,16 @@ func doWatch(stream v3.Watcher, requests <-chan string) {
|
||||
|
||||
func recvWatchChan(wch v3.WatchChan) {
|
||||
for range wch {
|
||||
if atomic.LoadInt32(&nrRecvCompleted) == int32(eventsTotal) {
|
||||
recvCompletedNotifier <- struct{}{}
|
||||
break
|
||||
}
|
||||
|
||||
st := time.Now()
|
||||
results <- result{duration: time.Since(st)}
|
||||
bar.Increment()
|
||||
|
||||
atomic.AddInt32(&nrRecvCompleted, 1)
|
||||
if atomic.LoadInt32(&nrRecvCompleted) == int32(eventsTotal) {
|
||||
recvCompletedNotifier <- struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user