Skip to content

Commit

Permalink
Merge pull request #6550 from heyitsanthony/watch-prog-notify
Browse files Browse the repository at this point in the history
clientv3: make IsProgressNotify() false on compact event and closed channel
  • Loading branch information
Anthony Romano committed Sep 29, 2016
2 parents dac6e70 + 6ac284a commit c349e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clientv3/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (wr *WatchResponse) Err() error {

// IsProgressNotify returns true if the WatchResponse is progress notification.
func (wr *WatchResponse) IsProgressNotify() bool {
return len(wr.Events) == 0 && !wr.Canceled && !wr.Created
return len(wr.Events) == 0 && !wr.Canceled && !wr.Created && wr.CompactRevision == 0 && wr.Header.Revision != 0
}

// watcher implements the Watcher interface
Expand Down
2 changes: 1 addition & 1 deletion proxy/grpcproxy/watcher_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestWatchgroupBroadcast(t *testing.T) {
}

// send a progress response
wch <- clientv3.WatchResponse{}
wch <- clientv3.WatchResponse{Header: pb.ResponseHeader{Revision: 1}}

for _, ch := range chs {
<-ch
Expand Down

0 comments on commit c349e08

Please sign in to comment.