mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
middleware/proxy: remove singleinflight from dns (#717)
Singleinflight interferes with the health checking of upstream. If an upstream would fail, singleinflight would mirror that error to to other proxy *iff* multple identical queries would be inflight. This would lead to marking *all* upstreams as bad, essentially collapsing multiple upstreams into a SPOF. Clearly not what we want. Singleinflight does have some nice properties, but I've opted to rip it out entirely. Caching should almost (but not quite) as good. Added a test case in test that uses 3 CoreDNS instances to reflect the setup from #715. Found another bug as well, where (when the policy would be nil), we would always Spray even though we've found a healthy host.
This commit is contained in:
@@ -328,6 +328,9 @@ func (u *staticUpstream) Select() *UpstreamHost {
|
||||
|
||||
if u.Policy == nil {
|
||||
h := (&Random{}).Select(pool)
|
||||
if h != nil {
|
||||
return h
|
||||
}
|
||||
if h == nil && u.Spray == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user