Commit graph

7 commits

Author SHA1 Message Date
Qasim Sarfraz
74b84a1377
update all +build statements (#5271)
* update all +build statements

Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>

* remove old +build style

Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>
2022-03-18 07:11:14 -07:00
Miek Gieben
e08d3335b0
fuzz: revert setup function (#3189)
This can't be used in its current form; revert the entire PR.

Revert "fuzzing: allow setup function to be called (#3175)"

This reverts commit 62451fd3eb.
2019-08-25 19:01:35 +00:00
Muhammad Falak R Wani
01ccbbb12d fuzz: use gofuzz build tag instead of fuzz (#3185)
* fuzz: use gofuzz build tag instead of fuzz

Since go-fuzz does not support Go modules yet, vendor dependencies.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

* fuzz: avoid vendoring code for go-fuzz

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2019-08-25 13:02:44 +00:00
Miek Gieben
62451fd3eb
fuzzing: allow setup function to be called (#3175)
This allows to fuzzing of more interesting targets that require setup.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-24 18:13:47 +00:00
Tobias Schmidt
dd9fc8962c plugin/cache: Fix prefetching issues (#1363)
* Improve plugin/cache metrics

* Add coredns_cache_prefetch_total metric to track number of prefetches.
* Remove unnecessary Cache.get() call which would incorrectly increment
  cache counters.
* Initialize all counters and gauges at zero.

* Allow prefetching of a single request per ttl

The original implementation didn't allow prefetching queries which are
only requested once during the duration of a TTL. The minimum amount of
queries which had to be seen was therefore capped at 2.

This change also implements a real prefetch test. The existing test was
a noop and always passed regardless of any prefetch implementation.

* Fix prefetching for items with a short TTL

The default prefetch threshold (percentage) is 10% of the lifetime of a
cache item. With the previous implementation, this disabled prefetching
for all items with a TTL < 10s (the resulting percentage would be 0, at
which point a cached item is already discarded).

This change uses a time based threshold calculation and ensures that
a prefetch is triggered at a TTL of 1 at the latest.

* Fix wrong duration reporting of cached responses

The logging and metrics plugins (among others) included the duration of
a cache prefetch in the request latency of client request. This change
fixes this wrong reporting and executes the prefetch request in a
goroutine in the background.
2018-01-17 07:35:22 +00:00
Miek Gieben
0186aadfcf
fuzz: put fuzzing stuff in own build tag (#1215)
No need to have this build all the time.
2017-11-10 13:59:42 +00:00
Miek Gieben
4276d29b81 Add fuzzing infrastructure (#1118)
Fix file/fuzz.go build and docs in Makefile.fuzz
Each plugin can add a fuzz.go to join the fuzzing craze.
pkg/fuzz/do.go could be made a lot smarter, but is probably good enough
for starters.

$ make -f Makefile.fuzz <plugin>

will build with go-fuzz-build and then execute a go-fuzz run. Each
plugin's fuzz run uses a per-plugin directory to store the fuzz data.
2017-09-29 22:28:13 +01:00