mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04:00
middleware/cache: fix race (#757)
While adding a parallel performance benchmark I stumbled on a race condition (another reason to add performance benchmarks!), so this PR makes sure the msg is created in a race free manor and adds the parallel benchmark.
This commit is contained in:
1
middleware/cache/cache.go
vendored
1
middleware/cache/cache.go
vendored
@@ -113,7 +113,6 @@ func (w *ResponseWriter) WriteMsg(res *dns.Msg) error {
|
||||
cacheSize.WithLabelValues(Denial).Set(float64(w.ncache.Len()))
|
||||
}
|
||||
|
||||
setMsgTTL(res, uint32(duration.Seconds()))
|
||||
if w.prefetch {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user