Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions client/internal/dns/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@

// didn't find a working upstream server, let's disable and try later
if !success {
u.disable(errors.ErrorOrNil())
u.disableLocked(errors.ErrorOrNil())

if u.statusRecorder == nil {
return
Expand Down Expand Up @@ -351,9 +351,13 @@
return fmt.Errorf("upstream check call error")
}

err := backoff.Retry(operation, exponentialBackOff)
err := backoff.Retry(operation, backoff.WithContext(exponentialBackOff, u.ctx))
if err != nil {
log.Warn(err)
if errors.Is(err, context.Canceled) {
log.Debugf("upstream retry loop exited for upstreams %s", u.upstreamServersString())
} else {
log.Warnf("upstream retry loop exited for upstreams %s: %v", u.upstreamServersString(), err)
}
return
}

Expand All @@ -374,7 +378,13 @@
return false
}

func (u *upstreamResolverBase) disable(err error) {

Check failure on line 381 in client/internal/dns/upstream.go

View workflow job for this annotation

GitHub Actions / Linux

func (*upstreamResolverBase).disable is unused (unused)

Check failure on line 381 in client/internal/dns/upstream.go

View workflow job for this annotation

GitHub Actions / Windows

func (*upstreamResolverBase).disable is unused (unused)

Check failure on line 381 in client/internal/dns/upstream.go

View workflow job for this annotation

GitHub Actions / Darwin

func (*upstreamResolverBase).disable is unused (unused)
u.mutex.Lock()
defer u.mutex.Unlock()
u.disableLocked(err)
}

func (u *upstreamResolverBase) disableLocked(err error) {
if u.disabled {
return
}
Expand Down
Loading