浏览代码

v3rpc: don't elide next progress notification on progress notification

Fixes #5878
Anthony Romano 10 年之前
父节点
当前提交
299ebc6137
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      etcdserver/api/v3rpc/watch.go

+ 2 - 1
etcdserver/api/v3rpc/watch.go

@@ -295,7 +295,8 @@ func (sws *serverWatchStream) sendLoop() {
 			}
 
 			sws.mu.Lock()
-			if _, ok := sws.progress[wresp.WatchID]; ok {
+			if len(evs) > 0 && sws.progress[wresp.WatchID] {
+				// elide next progress update if sent a key update
 				sws.progress[wresp.WatchID] = false
 			}
 			sws.mu.Unlock()