Skip to content

Commit

Permalink
Merge pull request #6587 from heyitsanthony/watch-fix-revrace
Browse files Browse the repository at this point in the history
clientv3: fix race on watch initial revision
  • Loading branch information
Anthony Romano authored Oct 5, 2016
2 parents d5cd563 + 06d5cf2 commit f67f8d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clientv3/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{
if !resuming {
ws.closing = true
}
ws.initReq.rev = nextRev
close(ws.donec)
if !resuming {
w.closingc <- ws
Expand Down Expand Up @@ -619,6 +618,7 @@ func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{
if len(wr.Events) > 0 {
nextRev = wr.Events[len(wr.Events)-1].Kv.ModRevision + 1
}
ws.initReq.rev = nextRev
case <-ws.initReq.ctx.Done():
return
case <-resumec:
Expand Down

0 comments on commit f67f8d3

Please sign in to comment.