mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
cmd/ctrld: do not retry failed query
Most the client will retry failed request itself. Doing this on the server give no benefit, and could cause un-necessary load when the server is busy.
This commit is contained in:
@@ -244,15 +244,7 @@ func (p *prog) proxy(ctx context.Context, upstreams []string, failoverRcodes []i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
answer, err := resolve1(n, upstreamConfig, msg)
|
answer, err := resolve1(n, upstreamConfig, msg)
|
||||||
// Only do re-bootstrapping if bootstrap ip is not explicitly set by user.
|
if err != nil {
|
||||||
if err != nil && upstreamConfig.BootstrapIP == "" {
|
|
||||||
ctrld.Log(ctx, mainLog.Debug().Err(err), "could not resolve query on first attempt, retrying...")
|
|
||||||
// If any error occurred, re-bootstrap transport/ip, retry the request.
|
|
||||||
upstreamConfig.ReBootstrap()
|
|
||||||
answer, err = resolve1(n, upstreamConfig, msg)
|
|
||||||
if err == nil {
|
|
||||||
return answer
|
|
||||||
}
|
|
||||||
ctrld.Log(ctx, mainLog.Error().Err(err), "failed to resolve query")
|
ctrld.Log(ctx, mainLog.Error().Err(err), "failed to resolve query")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user