mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
OS resolver retry should respect the leak_on_upstream_failure config option
This commit is contained in:
@@ -640,19 +640,20 @@ func (p *prog) proxy(ctx context.Context, req *proxyRequest) *proxyResponse {
|
|||||||
} else {
|
} else {
|
||||||
mainLog.Load().Debug().Msg("One upstream is down but at least one is healthy; skipping recovery trigger")
|
mainLog.Load().Debug().Msg("One upstream is down but at least one is healthy; skipping recovery trigger")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// attempt query to OS resolver while as a retry catch all
|
// attempt query to OS resolver while as a retry catch all
|
||||||
if upstreams[0] != upstreamOS {
|
// we dont want this to happen if leakOnUpstreamFailure is false
|
||||||
ctrld.Log(ctx, mainLog.Load().Debug(), "attempting query to OS resolver as a retry catch all")
|
if upstreams[0] != upstreamOS {
|
||||||
answer := resolve(upstreamOS, osUpstreamConfig, req.msg)
|
ctrld.Log(ctx, mainLog.Load().Debug(), "attempting query to OS resolver as a retry catch all")
|
||||||
if answer != nil {
|
answer := resolve(upstreamOS, osUpstreamConfig, req.msg)
|
||||||
ctrld.Log(ctx, mainLog.Load().Debug(), "OS resolver retry query successful")
|
if answer != nil {
|
||||||
res.answer = answer
|
ctrld.Log(ctx, mainLog.Load().Debug(), "OS resolver retry query successful")
|
||||||
res.upstream = osUpstreamConfig.Endpoint
|
res.answer = answer
|
||||||
return res
|
res.upstream = osUpstreamConfig.Endpoint
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
ctrld.Log(ctx, mainLog.Load().Debug(), "OS resolver retry query failed")
|
||||||
}
|
}
|
||||||
ctrld.Log(ctx, mainLog.Load().Debug(), "OS resolver retry query failed")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
answer := new(dns.Msg)
|
answer := new(dns.Msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user