mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: avoid closing a watch with ID 0 incorrectly
Signed-off-by: Kafuu Chino <KafuuChinoQ@gmail.com> add test 1 1 1 1 1 1
This commit is contained in:
@@ -238,7 +238,7 @@ func (wps *watchProxyStream) recvLoop() error {
|
||||
if err := wps.checkPermissionForWatch(cr.Key, cr.RangeEnd); err != nil {
|
||||
wps.watchCh <- &pb.WatchResponse{
|
||||
Header: &pb.ResponseHeader{},
|
||||
WatchId: -1,
|
||||
WatchId: clientv3.InvalidWatchID,
|
||||
Created: true,
|
||||
Canceled: true,
|
||||
CancelReason: err.Error(),
|
||||
@@ -258,7 +258,7 @@ func (wps *watchProxyStream) recvLoop() error {
|
||||
filters: v3rpc.FiltersFromRequest(cr),
|
||||
}
|
||||
if !w.wr.valid() {
|
||||
w.post(&pb.WatchResponse{WatchId: -1, Created: true, Canceled: true})
|
||||
w.post(&pb.WatchResponse{WatchId: clientv3.InvalidWatchID, Created: true, Canceled: true})
|
||||
wps.mu.Unlock()
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user