From 056d0fcbb4ed753db699ddb4e27e344663b2a833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Mon, 21 Oct 2024 09:50:54 +0300 Subject: [PATCH] discovery/dns: resolve again if err happens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UpdateState() docs say that if an error happens then the resolver should try again. Let's do that. Fixes a problem for us in prod. Signed-off-by: Giedrius Statkevičius --- pkg/discovery/dns/grpc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/discovery/dns/grpc.go b/pkg/discovery/dns/grpc.go index 4e315596df..e45fe0771e 100644 --- a/pkg/discovery/dns/grpc.go +++ b/pkg/discovery/dns/grpc.go @@ -86,7 +86,10 @@ func (r *resolver) run() { raddr := grpcresolver.Address{Addr: addr} state.Addresses = append(state.Addresses, raddr) } - _ = r.cc.UpdateState(state) + err = r.cc.UpdateState(state) + if err != nil { + continue + } } select { case <-r.ctx.Done():