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
+1 -1
View File
@@ -47,7 +47,7 @@ func resolve(ctx context.Context, msg *dns.Msg, endpoint string, tlsConfig *tls.
func doResolve(ctx context.Context, msg *dns.Msg, endpoint string, tlsConfig *tls.Config) (*dns.Msg, error) {
session, err := quic.DialAddr(endpoint, tlsConfig, nil)
if err != nil {
return nil, ErrUpstreamFailed
return nil, err
}
defer session.CloseWithError(quic.ApplicationErrorCode(quic.NoError), "")