mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
cmd/cli: perform leaking queries in non-cd mode
This commit is contained in:
committed by
Cuong Manh Le
parent
89f7874fc6
commit
cb49d0d947
@@ -595,7 +595,7 @@ func (p *prog) proxy(ctx context.Context, req *proxyRequest) *proxyResponse {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
ctrld.Log(ctx, mainLog.Load().Error(), "all %v endpoints failed", upstreams)
|
ctrld.Log(ctx, mainLog.Load().Error(), "all %v endpoints failed", upstreams)
|
||||||
if cdUID != "" && p.leakOnUpstreamFailure() {
|
if p.leakOnUpstreamFailure() {
|
||||||
p.leakingQueryMu.Lock()
|
p.leakingQueryMu.Lock()
|
||||||
if !p.leakingQueryWasRun {
|
if !p.leakingQueryWasRun {
|
||||||
p.leakingQueryWasRun = true
|
p.leakingQueryWasRun = true
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ func Test_canonicalName(t *testing.T) {
|
|||||||
|
|
||||||
func Test_prog_upstreamFor(t *testing.T) {
|
func Test_prog_upstreamFor(t *testing.T) {
|
||||||
cfg := testhelper.SampleConfig(t)
|
cfg := testhelper.SampleConfig(t)
|
||||||
|
cfg.Service.LeakOnUpstreamFailure = func(v bool) *bool { return &v }(false)
|
||||||
p := &prog{cfg: cfg}
|
p := &prog{cfg: cfg}
|
||||||
p.um = newUpstreamMonitor(p.cfg)
|
p.um = newUpstreamMonitor(p.cfg)
|
||||||
p.lanLoopGuard = newLoopGuard()
|
p.lanLoopGuard = newLoopGuard()
|
||||||
|
|||||||
Reference in New Issue
Block a user