From 365f6b7d220afcb0d478e90d11409f655eed748a Mon Sep 17 00:00:00 2001 From: Carlos Hernandez Date: Fri, 16 Aug 2024 10:39:14 -0600 Subject: [PATCH] Fixing typos and logging --- client/internal/dns/upstream.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/internal/dns/upstream.go b/client/internal/dns/upstream.go index fd949ea29ba..1d8499a5cdf 100644 --- a/client/internal/dns/upstream.go +++ b/client/internal/dns/upstream.go @@ -92,7 +92,7 @@ func (u *upstreamResolverBase) watchPeersConnStatusChanges() { u.probeAvailability() if u.disabled { - return fmt.Errorf("probe faled") + return fmt.Errorf("probe failed") } return nil } @@ -100,7 +100,7 @@ func (u *upstreamResolverBase) watchPeersConnStatusChanges() { continualProbe := func() { // probe continually for 30s when peer count >= 1 if u.statusRecorder.GetConnectedPeersCount() == 0 { - log.Debug("O peer connected, running one more DNS probe") + log.Debug("O peers connected, running one more DNS probe") // cancel backoff operation if cancelBackOff != nil { cancelBackOff() @@ -111,13 +111,13 @@ func (u *upstreamResolverBase) watchPeersConnStatusChanges() { } if probeRunning.Load() { - log.Info("restarting DNS probing") + log.Info("restart DNS probing") cancelBackOff() cancelBackOff = nil } defer func() { u.mutex.Lock() - log.Infof("DNS probing finished, servers %s disabled: %t", u.upstreamServers, u.disabled) + log.Infof("DNS probe finished, servers %s disabled: %t", u.upstreamServers, u.disabled) u.mutex.Unlock() probeRunning.Store(false) }() @@ -128,7 +128,6 @@ func (u *upstreamResolverBase) watchPeersConnStatusChanges() { err := backoff.Retry(func() error { select { case <-ctx.Done(): - log.Warn("DNS probing cancelled") return backoff.Permanent(ctx.Err()) default: return operation() @@ -136,7 +135,7 @@ func (u *upstreamResolverBase) watchPeersConnStatusChanges() { }, backoff.WithContext(exponentialBackOff, ctx)) cancelBackOff = nil if err != nil { - log.Warn("DNS probe trigger by peer connection failed") + log.Warnf("DNS probe trigger by peer connection stopped: %s", err) u.disable(err) return } @@ -317,7 +316,8 @@ func (u *upstreamResolverBase) waitUntilResponse() { err := backoff.Retry(func() error { u.probeAvailability() if u.disabled { - return fmt.Errorf("failed to enable upsstream") + log.Tracef("checking connectivity with upstreams %s failed. Retrying in %s", u.upstreamServers, exponentialBackOff.NextBackOff()) + return fmt.Errorf("upstream check call error") } return nil }, exponentialBackOff)