aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2020-12-15 08:02:15 -0500
committerGravatar GitHub <noreply@github.com> 2020-12-15 14:02:15 +0100
commit9cb53487ecc7ded29672b22bc7716a8eec095865 (patch)
treef369a9f47671f2117c78e7a94c4309a6426b6ac3 /plugin/forward
parent45bf23f14526ecca4e72a7c5adc84e0e92f490e4 (diff)
downloadcoredns-9cb53487ecc7ded29672b22bc7716a8eec095865.tar.gz
coredns-9cb53487ecc7ded29672b22bc7716a8eec095865.tar.zst
coredns-9cb53487ecc7ded29672b22bc7716a8eec095865.zip
respond with REFUSED when max_concurrent is exceeded to avoid caching it (#4326)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/forward')
-rw-r--r--plugin/forward/README.md2
-rw-r--r--plugin/forward/forward.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugin/forward/README.md b/plugin/forward/README.md
index 359fd3827..52625249c 100644
--- a/plugin/forward/README.md
+++ b/plugin/forward/README.md
@@ -88,7 +88,7 @@ forward FROM TO... {
* `no_rec` - optional argument that sets the RecursionDesired-flag of the dns-query used in health checking to `false`.
The flag is default `true`.
* `max_concurrent` **MAX** will limit the number of concurrent queries to **MAX**. Any new query that would
- raise the number of concurrent queries above the **MAX** will result in a SERVFAIL response. This
+ raise the number of concurrent queries above the **MAX** will result in a REFUSED response. This
response does not count as a health failure. When choosing a value for **MAX**, pick a number
at least greater than the expected *upstream query rate* * *latency* of the upstream servers.
As an upper bound for **MAX**, consider that each concurrent query will use about 2kb of memory.
diff --git a/plugin/forward/forward.go b/plugin/forward/forward.go
index eff8f7030..5f7d343de 100644
--- a/plugin/forward/forward.go
+++ b/plugin/forward/forward.go
@@ -83,7 +83,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
defer atomic.AddInt64(&(f.concurrent), -1)
if count > f.maxConcurrent {
MaxConcurrentRejectCount.Add(1)
- return dns.RcodeServerFailure, f.ErrLimitExceeded
+ return dns.RcodeRefused, f.ErrLimitExceeded
}
}