|
@@ -56,6 +56,7 @@ func NewWatchProxy(c *clientv3.Client) pb.WatchServer {
|
|
|
func (wp *watchProxy) Watch(stream pb.Watch_WatchServer) (err error) {
|
|
func (wp *watchProxy) Watch(stream pb.Watch_WatchServer) (err error) {
|
|
|
wp.mu.Lock()
|
|
wp.mu.Lock()
|
|
|
wp.nextStreamID++
|
|
wp.nextStreamID++
|
|
|
|
|
+ sid := wp.nextStreamID
|
|
|
wp.mu.Unlock()
|
|
wp.mu.Unlock()
|
|
|
|
|
|
|
|
sws := serverWatchStream{
|
|
sws := serverWatchStream{
|
|
@@ -64,7 +65,7 @@ func (wp *watchProxy) Watch(stream pb.Watch_WatchServer) (err error) {
|
|
|
singles: make(map[int64]*watcherSingle),
|
|
singles: make(map[int64]*watcherSingle),
|
|
|
inGroups: make(map[int64]struct{}),
|
|
inGroups: make(map[int64]struct{}),
|
|
|
|
|
|
|
|
- id: wp.nextStreamID,
|
|
|
|
|
|
|
+ id: sid,
|
|
|
gRPCStream: stream,
|
|
gRPCStream: stream,
|
|
|
|
|
|
|
|
watchCh: make(chan *pb.WatchResponse, 1024),
|
|
watchCh: make(chan *pb.WatchResponse, 1024),
|