Skip to content

Commit

Permalink
Improve handling of failing dns resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Jul 20, 2020
1 parent 8dea8e6 commit 25a3f60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions resolver/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,14 @@ resolveLoop:
// we are offline and this is not an online check query
return nil, ErrOffline
default:
// includes ErrTimeout
log.Tracer(ctx).Debugf("resolver: failed to resolve %s: %s", q.FQDN, err)
}
} else {
// no error
if rrCache == nil {
// defensive: assume NXDomain
return nil, ErrNotFound
}
break resolveLoop
}
if rrCache == nil {
continue
}
break resolveLoop
}
}

Expand Down
2 changes: 1 addition & 1 deletion resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (

var (
// FailThreshold is amount of errors a resolvers must experience in order to be regarded as failed.
FailThreshold = 5
FailThreshold = 20
)

// Resolver holds information about an active resolver.
Expand Down

0 comments on commit 25a3f60

Please sign in to comment.