Skip to content

Commit

Permalink
fix: filter redundant endpoints invalid (#3373)
Browse files Browse the repository at this point in the history
  • Loading branch information
LHyphen authored Jul 25, 2024
1 parent 9260862 commit c550cda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport/grpc/resolver/discovery/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (r *discoveryResolver) update(ins []*registry.ServiceInstance) {
if _, ok := endpoints[ept]; ok {
continue
}
endpoints[ept] = struct{}{}
filtered = append(filtered, in)
}
if r.subsetSize != 0 {
Expand All @@ -75,7 +76,6 @@ func (r *discoveryResolver) update(ins []*registry.ServiceInstance) {
addrs := make([]resolver.Address, 0, len(filtered))
for _, in := range filtered {
ept, _ := endpoint.ParseEndpoint(in.Endpoints, endpoint.Scheme("grpc", !r.insecure))
endpoints[ept] = struct{}{}
addr := resolver.Address{
ServerName: in.Name,
Attributes: parseAttributes(in.Metadata).WithValue("rawServiceInstance", in),
Expand Down

0 comments on commit c550cda

Please sign in to comment.