mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
grpcproxy: only coalesce watchers that have received create response
Current watchers may have nextrev=0; check response count instead.
This commit is contained in:
parent
a2e86c1371
commit
e40da39143
@ -60,8 +60,10 @@ func (wbs *watchBroadcasts) coalesce(wb *watchBroadcast) {
|
||||
continue
|
||||
}
|
||||
wbswb.mu.Lock()
|
||||
// NB: victim lock already held
|
||||
if wb.nextrev >= wbswb.nextrev && wbswb.nextrev != 0 {
|
||||
// 1. check if wbswb is behind wb so it won't skip any events in wb
|
||||
// 2. ensure wbswb started; nextrev == 0 may mean wbswb is waiting
|
||||
// for a current watcher and expects a create event from the server.
|
||||
if wb.nextrev >= wbswb.nextrev && wbswb.responses > 0 {
|
||||
for w := range wb.receivers {
|
||||
wbswb.receivers[w] = struct{}{}
|
||||
wbs.watchers[w] = wbswb
|
||||
|
Loading…
x
Reference in New Issue
Block a user