I think this is causing problem and it will actually clash with the
scrubbing that now happens for all plugins anyway. We're assuming the
returned message will be valid even with tc being set. request.Scrub
follows that same logic.
Signed-off-by: Miek Gieben <miek@miek.nl>
* pkg/up: implement backoff
Every 2nd failure we double the interval until we hit 4 * interval. This
to have some sort of backoff, esp when a large cluster of coredns shares
an upstream (original intent of up package) they will hammer the
upstream. This put some back pressure on that.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Update plugin/pkg/up/up.go
Co-Authored-By: miekg <miek@miek.nl>
Upgrade to new dns lib version; that saw multiple improvements; some
patch releases are in the pipeline.
The big thing here is the removal of ErrTruncated, so we need to deal
with this slightly different in the forward plugin. It removed the
entire truncated.go logic and just checks the message for .Truncated (if
there is a message) and retries with tcp.
Signed-off-by: Miek Gieben <miek@miek.nl>
The loadbalancer plugin reorders records. It was doing this for zone
transfers - if you had a CNAME in the zone then your transfer would
be broken because it would get put before the SOA record.
* plugin/forward: remove dynamic read timeout
We care about an upstream being there, so we still have a dynamic dial
time out (by way higher then 200ms) of 1s; this should be fairly stable
for an upstream. The read timeout if more variable because of cached and
non cached responses. As such remove his logic entirely.
Drop to 2s read timeout.
Fixes#2306
Signed-off-by: Miek Gieben <miek@miek.nl>
* Set SOA record TTL as min of TTL/MINIMUM
According to
https://tools.ietf.org/html/rfc2308#section-3:
The TTL of this record is set from the minimum
of the MINIMUM field of the SOA record and the
TTL of the SOA itself, and indicates how long a
resolver may cache the negative answer.
Set the TTL accordingly so as to not always
negative cache SOA records for 300 seconds.
* Inline min func
* Update SOA record tests
* Fix types
* Redo the plugin log PR
Remove the code duplication and call of the "official" functions. This
is the second(?) time we forgot to update the other half, so remove that
problem entirely.
Also add a test if the correct (within limits) time in front of the log
line.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Remove pFormat
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add email next to my github handle
Following Governance description, I add my email next to my github handle.
I would need for CNCF Graduation to show the different organizations the maintainers are from. Anyone with no email or personal email (like gmail) will be considered under its own organization.
That would also help when vote will come-in, as we restraint votes for people on the same organization.
@miekg :
* I guess that will need change in the dreck project that parse this file.
* Do you want me to PR the change on that project (miek/dreck) ?
* Update with a comment
Co-Authored-By: fturib <ftur@infoblox.com>
* Project lead
This change is considered as part of the GOVERNANCE.md update (11/12/2018)
to add the project lead in OWNERS file. The term (11/12/2019) aligns
with GOVERNANCE.md update.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Change term to 11/11/2019, as it should be part of the GOVERNANCE.md update (11/12/2018)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update to use comment
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
999 chops of suffix zero, 000 allows for the milliseconds to be always
printed with 3 chars. This makes the log the printed with the same
columns.
(partial logs below)
2018-11-13T21:13:28.249Z [INFO] [::1]
2018-11-13T21:13:48.414Z [INFO] [::1]
2018-11-13T21:13:49.1Z [INFO] [::1]
vs:
2018-11-13T21:20:22.262Z [INFO] [::1]
2018-11-13T21:20:22.436Z [INFO] [::1]
2018-11-13T21:20:22.608Z [INFO] [::1]
Signed-off-by: Miek Gieben <miek@miek.nl>
* plugin/host: parse file without holding lock
Parse first and then swap the maps *while* holding the lock.
Signed-off-by: Miek Gieben <miek@miek.nl>
* add back in the parse function, but now purely for testing
Signed-off-by: Miek Gieben <miek@miek.nl>
This is now the raw size which may be larger than what a particular
client actually sees.
Clarify this a bit.
Fixes#2258
Signed-off-by: Miek Gieben <miek@miek.nl>
* fix truncation bug
* Generate records with generic RRs
* Remove SoundCloud from test name
* Comment for binary-search -1 adjustment
Explain why the binary search may have exited with
a reply size that is too large by one record.
* Refactor to remove sub variable
patch suggested by miek removes unnecessary sub
variable for removing a single line from the
reply.Extra length.
* - UT on metrics verifying that all plugins of all blocs have their metrics collectors declared
* - fix error msg
* - redirect Registry of metric to the one that handle the listener
- allow duplicate of metrics collector on the same Registry (case of same plugin in 2 blocs listening metrics on the same address)
* - fix change of signature
* - ensure cleaning metrics before starting the test (metrics collectors are global vars .. and re-used by several tests)
* - I think I fixed this test. Ensure correct mn of hits and clean metrics before test.
* - fix typo in error msg - proposed at review
* - fix typo in comment
* - remove ResetMetrics functions
- change a way to test the numeric metrics : get the diff between begin and end of test
* - oops. removing debug logs
Default to using pkg/log for all logging and use a fixed time prefix
which is RFC3339Millli (doesn't exist in time, so we just extended
RFC3339), i.e. Nano might be pushing it.
Logs go from:
2018/10/30 19:14:55 [INFO] CoreDNS-1.2.5
2018/10/30 19:14:55 [INFO] linux/amd64, go1.11,
to:
2018-10-30T19:10:07.547Z [INFO] CoreDNS-1.2.5
2018-10-30T19:10:07.547Z [INFO] linux/amd64, go1.11,
Which includes the timezone - which oddly the std log package doesn't
natively do.
Signed-off-by: Miek Gieben <miek@miek.nl>
When fetching records via the etcd plugin, the recursion flag was never
set properly according to if the caller requested an exact record match
or not. This cause problems especially in CNAME lookups, where recursion
took place and a random RR was returned instead of the one that was
specifically added for this key. Even when there is no service attached
on the given path, it is still wrong to return a random one from the
recursion.
Fixing by using the `exact` flag to decide if recursion should be done.