mirror of
https://github.com/coredns/coredns.git
synced 2025-12-06 02:15:11 -05:00
fix(forward): prevent busy loop on connection err (#7704)
Fixes a bug in the forward plugin where an immediate connection failure (e.g., TCP RST) could trigger an infinite busy loop. The retry logic failed to increment the "fails" counter when a connection error occurred, causing the loop condition to remain permanently true. This patch fixes it and adds a regression test. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -191,6 +191,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
proxy.Healthcheck()
|
||||
}
|
||||
|
||||
fails++
|
||||
if fails < len(f.proxies) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user