mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
plugin/proxy: when HC fails increase fails (#1270)
When we failing the healthcheck we should increate the fails for this host; which is the *bleeping* point of doing the HC in the first place. Add the missing atomic.Adds. Fixes #1247
This commit is contained in:
@@ -123,6 +123,7 @@ func (uh *UpstreamHost) HealthCheckURL() {
|
||||
|
||||
if err != nil {
|
||||
log.Printf("[WARNING] Host %s health check probe failed: %v", uh.Name, err)
|
||||
atomic.AddInt32(&uh.Fails, 1)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -132,6 +133,7 @@ func (uh *UpstreamHost) HealthCheckURL() {
|
||||
|
||||
if r.StatusCode < 200 || r.StatusCode >= 400 {
|
||||
log.Printf("[WARNING] Host %s health check returned HTTP code %d", uh.Name, r.StatusCode)
|
||||
atomic.AddInt32(&uh.Fails, 1)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user