mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
middleware/proxy: healthchecks fixes (#183)
* middleware/proxy: add spray keyword When spray is used, the proxy will, when all backend are down, spray to each target. When not used, default to the old defaults: max 1 failure and no spray. These defaults are also used when forwarding queries to another CoreDNS instance. Update the README with the new keyword. * typos * Make MaxFail = 1 again * more reversals
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package proxy
|
||||
|
||||
// function OTHER middleware might want to use to do lookup in the same
|
||||
// functions OTHER middleware might want to use to do lookup in the same
|
||||
// style as the proxy.
|
||||
|
||||
import (
|
||||
@@ -77,8 +77,8 @@ func (p Proxy) lookup(state middleware.State, r *dns.Msg) (*dns.Msg, error) {
|
||||
// hosts until timeout (or until we get a nil host).
|
||||
for time.Now().Sub(start) < tryDuration {
|
||||
host := upstream.Select()
|
||||
|
||||
if host == nil {
|
||||
// TODO(miek): if all HC fail, spray the targets.
|
||||
return nil, errUnreachable
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user