Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
9cb53487
Commit
9cb53487
authored
Dec 15, 2020
by
Chris O'Haver
Committed by
GitHub
Dec 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
respond with REFUSED when max_concurrent is exceeded to avoid caching it (#4326)
Signed-off-by:
Chris O'Haver
<
cohaver@infoblox.com
>
parent
45bf23f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
plugin/forward/README.md
plugin/forward/README.md
+1
-1
plugin/forward/forward.go
plugin/forward/forward.go
+1
-1
plugin/pkg/response/typify_test.go
plugin/pkg/response/typify_test.go
+10
-0
No files found.
plugin/forward/README.md
View file @
9cb53487
...
...
@@ -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.
...
...
plugin/forward/forward.go
View file @
9cb53487
...
...
@@ -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
.
Rcode
ServerFailure
,
f
.
ErrLimitExceeded
return
dns
.
Rcode
Refused
,
f
.
ErrLimitExceeded
}
}
...
...
plugin/pkg/response/typify_test.go
View file @
9cb53487
...
...
@@ -60,6 +60,16 @@ func TestTypifyImpossible(t *testing.T) {
}
}
func
TestTypifyRefused
(
t
*
testing
.
T
)
{
m
:=
new
(
dns
.
Msg
)
m
.
SetQuestion
(
"foo.example.org."
,
dns
.
TypeA
)
m
.
Rcode
=
dns
.
RcodeRefused
mt
,
_
:=
Typify
(
m
,
time
.
Now
()
.
UTC
())
if
mt
!=
OtherError
{
t
.
Errorf
(
"Refused message not typified as OtherError, got %s"
,
mt
)
}
}
func
delegationMsg
()
*
dns
.
Msg
{
return
&
dns
.
Msg
{
Ns
:
[]
dns
.
RR
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment