diff options
author | 2017-04-13 16:26:05 +0100 | |
---|---|---|
committer | 2017-04-13 16:26:05 +0100 | |
commit | acbf522cebdcd53c26d153c1d9267d709ba75f64 (patch) | |
tree | 9c2e3e31041a1ef2a49bd7118a0b1c56813a82d5 /middleware/proxy/google.go | |
parent | ef4fa66e670fabe5c4dcfecc319c0f99d02bfd07 (diff) | |
download | coredns-acbf522cebdcd53c26d153c1d9267d709ba75f64.tar.gz coredns-acbf522cebdcd53c26d153c1d9267d709ba75f64.tar.zst coredns-acbf522cebdcd53c26d153c1d9267d709ba75f64.zip |
middleware/proxy: Make Unhealthy a pointer (#615)
Pointer updates are atomic so drop the sync.RWMutex as it is not needed
anymore. This also fixes the race introduced with dfc71df (although I
believe this is the first time we properly tested that code path).
Diffstat (limited to 'middleware/proxy/google.go')
-rw-r--r-- | middleware/proxy/google.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/middleware/proxy/google.go b/middleware/proxy/google.go index dc83755ad..09fb13e2f 100644 --- a/middleware/proxy/google.go +++ b/middleware/proxy/google.go @@ -218,11 +218,11 @@ func newUpstream(hosts []string, old *staticUpstream) Upstream { Conns: 0, Fails: 0, FailTimeout: upstream.FailTimeout, - Unhealthy: false, + Unhealthy: newBool(), CheckDown: func(upstream *staticUpstream) UpstreamHostDownFunc { return func(uh *UpstreamHost) bool { - if uh.Unhealthy { + if *uh.Unhealthy { return true } |