mirror of
https://github.com/coredns/coredns.git
synced 2026-07-21 23:20:13 -04:00
plugin/forward: Fix incorrect retry of local DNS message serialization failures (#8313)
This PR fixes the forward plugin incorrectly retrying deterministic local DNS message serialization failures as if they were upstream transport errors. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -206,6 +206,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
upstreamErr = err
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, proxyPkg.ErrInvalidRequest) {
|
||||
return dns.RcodeFormatError, err
|
||||
}
|
||||
|
||||
// Kick off health check to see if *our* upstream is broken.
|
||||
if f.maxfails != 0 {
|
||||
proxy.Healthcheck()
|
||||
|
||||
Reference in New Issue
Block a user