Repository navigation
Conversation
StrictResolver dropped the error of every upstream and returned its own when none answered. Over UDP, TCP and DoT an upstream's SERVFAIL comes as an UpstreamServerError, so with `strategy: strict` it never reached the server: the client got a SERVFAIL without the upstream's extended DNS error, and every such query logged an ERROR. The errors are now joined into the returned one, as ParallelBestResolver does, so the server finds the UpstreamServerError and answers with the upstream's message. Failing over to the next upstream is unchanged. Fixes 0xERR0R#2436
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2441 +/- ##
==========================================
- Coverage 92.68% 92.67% -0.01%
==========================================
Files 137 137
Lines 9923 9926 +3
==========================================
+ Hits 9197 9199 +2
- Misses 725 726 +1
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2436.
With
strategy: strict,StrictResolverdropped every upstream's error and returned its own once none of them answered. Over UDP, TCP and DoT an upstream's SERVFAIL comes back as anUpstreamServerError, so it never made it toServer.resolve. The client got blocky's own SERVFAIL without the upstream's extended DNS error, and each such query loggederror on processing request.Now the errors are joined into the one it returns, the same way
ParallelBestResolverdoes it.Server.resolvefinds theUpstreamServerErrorand answers with the upstream's message. Failover to the next upstream works the same as before.If several upstreams answer SERVFAIL, the client gets the first one's, since
errors.AsTypewalks the joined errors in order. Withstrictthat's the preferred upstream, which seemed like the right one to show.Tests (in
strict_resolver_test.go, the upstream mock answers SERVFAIL with an EDE so the test can tell its message from one blocky made):The first two fail without the change.
go vet ./resolver/and the strict specs pass. I didn't add a server-level test, sinceServer.resolvealready handles theUpstreamServerErrorthatparallel_bestreturns.