mirror of
https://github.com/coredns/coredns.git
synced 2026-08-20 23:08:28 -04:00
plugin/forward: cap default connect attempts (#8365)
Default to two connect attempts per configured upstream so fast failures cannot spin until the request deadline. Track whether max_connect_attempts was explicitly configured so zero still opts into the legacy unbounded behavior. Fixes #7723 Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
@@ -293,6 +293,7 @@ func parseBlock(c *caddy.Controller, f *Forward) error {
|
||||
return err
|
||||
}
|
||||
f.maxConnectAttempts = uint32(n)
|
||||
f.maxConnectAttemptsSet = true
|
||||
case "health_check":
|
||||
if !c.NextArg() {
|
||||
return c.ArgErr()
|
||||
|
||||
Reference in New Issue
Block a user