Skip to content

Commit

Permalink
Merge pull request #6340 from xiang90/fix_double_create
Browse files Browse the repository at this point in the history
grpcproxy: fix double create event
  • Loading branch information
xiang90 authored Sep 2, 2016
2 parents 81bd381 + 805d4cb commit 0d07154
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions proxy/grpcproxy/watcher_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ func (wgs *watchergroups) addWatcher(rid receiverID, w watcher) {
rev := wg.add(rid, w)
wgs.idToGroup[rid] = wg

if rev == 0 {
// The group is newly created, the create event has not been delivered
// to this group yet.
// We can rely on etcd server to deliver the create event.
// Or we might end up sending created event twice.
return
}

resp := &pb.WatchResponse{
Header: &pb.ResponseHeader{
// todo: fill in ClusterId
Expand Down

0 comments on commit 0d07154

Please sign in to comment.