all: retry the request more agressively

For better recovery and dealing with network stack changes, this commit
change the request flow to:

failure of any kind -> recreate transport/re-bootstrap -> retry once

That would make ctrld recover from all scenarios in theory.
This commit is contained in:
Cuong Manh Le
2023-03-03 00:47:21 +07:00
committed by Cuong Manh Le
parent 262dcb1dff
commit fb20d443c1
6 changed files with 36 additions and 35 deletions
-3
View File
@@ -93,8 +93,5 @@ func (r *legacyResolver) Resolve(ctx context.Context, msg *dns.Msg) (*dns.Msg, e
Dialer: dialer,
}
answer, _, err := dnsClient.ExchangeContext(ctx, msg, r.endpoint)
if _, ok := err.(*net.OpError); ok {
return answer, ErrUpstreamFailed
}
return answer, err
}