fix(dnscheck): lower the default timeouts (#917)

Closes https://github.com/ooni/probe/issues/2234
This commit is contained in:
Simone Basso 2022-09-01 15:45:42 +02:00 committed by GitHub
parent 860426b874
commit cee89132af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,7 +211,7 @@ func (m *Measurer) Run(
HTTP3Enabled: m.Config.HTTP3Enabled, HTTP3Enabled: m.Config.HTTP3Enabled,
RejectDNSBogons: true, // bogons are errors in this context RejectDNSBogons: true, // bogons are errors in this context
ResolverURL: makeResolverURL(URL, addr), ResolverURL: makeResolverURL(URL, addr),
Timeout: 45 * time.Second, Timeout: 15 * time.Second,
}, },
Target: fmt.Sprintf("dnslookup://%s", domain), // urlgetter wants a URL Target: fmt.Sprintf("dnslookup://%s", domain), // urlgetter wants a URL
}) })
@ -234,7 +234,7 @@ func (m *Measurer) Run(
} }
func (m *Measurer) lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) { func (m *Measurer) lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) {
ctx, cancel := context.WithTimeout(ctx, 20*time.Second) ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel() defer cancel()
return r.LookupHost(ctx, hostname) return r.LookupHost(ctx, hostname)
} }