The resolver says its query timeout grows on each try, but it does not; timeoutMultiplier is unused #296

Closed
opened 2026-10-15 17:31:59 +02:00 by clawbot · 1 comment
Collaborator

What is wrong. internal/resolver/iterative.go declares timeoutMultiplier = 2 (line 22), which nothing uses. exchangeWithTimeout (lines 65-76) takes an attempt argument and throws it away with the comment timeout escalation handled by client config. Nothing escalates: both clients are built with the fixed queryTimeoutDuration of 2 seconds (internal/resolver/resolver.go lines 59-60 and 69-70), and every try waits the same 2 seconds.

Scenario. A contributor looking into a slow nameserver reads the comment, believes the second try already waits longer, and looks for the problem elsewhere.

Correct. The code says what it does: one fixed 2-second timeout per try, as the README and TESTING.md describe. The unused constant goes, and so do the unused argument and the comment that claims an escalation.

Done when: timeoutMultiplier is gone; exchangeWithTimeout takes no attempt (or is folded into its one caller, tryExchange) and no comment claims the timeout grows; behaviour is unchanged.

Plan. Package internal/resolver, whose doc covers iterative resolution; no new package. Remove the constant, the argument and the comment by hand; keep tryExchange's retry as it is. No new test: behaviour does not change, and the existing live resolver tests cover the retry. TODO.md Completed Steps entry in the same commit.

Severity: minor

Model: opus-5-5

**What is wrong.** `internal/resolver/iterative.go` declares `timeoutMultiplier = 2` (line 22), which nothing uses. `exchangeWithTimeout` (lines 65-76) takes an `attempt` argument and throws it away with the comment `timeout escalation handled by client config`. Nothing escalates: both clients are built with the fixed `queryTimeoutDuration` of 2 seconds (`internal/resolver/resolver.go` lines 59-60 and 69-70), and every try waits the same 2 seconds. **Scenario.** A contributor looking into a slow nameserver reads the comment, believes the second try already waits longer, and looks for the problem elsewhere. **Correct.** The code says what it does: one fixed 2-second timeout per try, as the README and `TESTING.md` describe. The unused constant goes, and so do the unused argument and the comment that claims an escalation. **Done when:** `timeoutMultiplier` is gone; `exchangeWithTimeout` takes no `attempt` (or is folded into its one caller, `tryExchange`) and no comment claims the timeout grows; behaviour is unchanged. **Plan.** Package `internal/resolver`, whose doc covers iterative resolution; no new package. Remove the constant, the argument and the comment by hand; keep `tryExchange`'s retry as it is. No new test: behaviour does not change, and the existing live resolver tests cover the retry. `TODO.md` Completed Steps entry in the same commit. Severity: minor Model: opus-5-5
clawbot self-assigned this 2026-10-15 17:31:59 +02:00
Author
Collaborator

Done in #297. timeoutMultiplier is gone, and exchangeWithTimeout is folded into tryExchange, whose comment now says every try waits the same 2-second queryTimeoutDuration. Behaviour is unchanged.

Model: opus-5-5

Done in https://git.eeqj.de/sneak/dnswatcher/pulls/297. `timeoutMultiplier` is gone, and `exchangeWithTimeout` is folded into `tryExchange`, whose comment now says every try waits the same 2-second `queryTimeoutDuration`. Behaviour is unchanged. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#296