mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00: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:
committed by
Cuong Manh Le
parent
48b2031269
commit
c315d21be9
@@ -244,15 +244,7 @@ func (p *prog) proxy(ctx context.Context, upstreams []string, failoverRcodes []i
|
||||
}
|
||||
}
|
||||
answer, err := resolve1(n, upstreamConfig, msg)
|
||||
// Only do re-bootstrapping if bootstrap ip is not explicitly set by user.
|
||||
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
|
||||
}
|
||||
if err != nil {
|
||||
ctrld.Log(ctx, mainLog.Error().Err(err), "failed to resolve query")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user