From cee89132afd8d99d9f9b5fec81c1ca0d6da7118d Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Thu, 1 Sep 2022 15:45:42 +0200 Subject: [PATCH] fix(dnscheck): lower the default timeouts (#917) Closes https://github.com/ooni/probe/issues/2234 --- internal/engine/experiment/dnscheck/dnscheck.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/engine/experiment/dnscheck/dnscheck.go b/internal/engine/experiment/dnscheck/dnscheck.go index c9fd3f8..f8353ce 100644 --- a/internal/engine/experiment/dnscheck/dnscheck.go +++ b/internal/engine/experiment/dnscheck/dnscheck.go @@ -211,7 +211,7 @@ func (m *Measurer) Run( HTTP3Enabled: m.Config.HTTP3Enabled, RejectDNSBogons: true, // bogons are errors in this context ResolverURL: makeResolverURL(URL, addr), - Timeout: 45 * time.Second, + Timeout: 15 * time.Second, }, 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) { - ctx, cancel := context.WithTimeout(ctx, 20*time.Second) + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) defer cancel() return r.LookupHost(ctx, hostname) }