Skip to content

Commit

Permalink
fix endless loop caused by ErrCompacted
Browse files Browse the repository at this point in the history
  • Loading branch information
lidengfu authored and kevwan committed Dec 17, 2023
1 parent 8f62a58 commit 761c36b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/discov/internal/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ func (c *cluster) watch(cli EtcdClient, key string, rev int64) {
if err == nil {
return
}
if errors.Is(err, v3rpc.ErrCompacted) {
if rev != 0 && errors.Is(err, v3rpc.ErrCompacted) {
logx.Errorf("etcd watch stream has been compacted, try to reload, rev %v", rev)
c.reload(cli)
rev = c.load(cli, key)
}
}
}
Expand Down

0 comments on commit 761c36b

Please sign in to comment.