Fixes#35 — resolver now distinguishes timeout from authoritative negative responses and retries on timeout/SERVFAIL.
Changes
New StatusTimeout constant — distinct from StatusError for timeout cases
Retry logic in querySingleType — 3 attempts with exponential backoff (100ms, 200ms, 400ms) for:
Timeout / no response
SERVFAIL
No retry for authoritative negatives:
NXDOMAIN → StatusNXDomain
NOERROR + empty answer → StatusNoData
Structured error information — NameserverResponse.Error field populated with descriptive messages for timeout and SERVFAIL
New ErrSERVFAIL sentinel error for proper static error handling
Design
Refactored querySingleType into smaller functions (querySingleTypeWithRetry, recordRetryFailure, handleDNSResponse, waitBackoff) to keep cyclomatic complexity within limits.
make check passes with 0 issues — see comment below.
## Summary
Fixes #35 — resolver now distinguishes timeout from authoritative negative responses and retries on timeout/SERVFAIL.
### Changes
1. **New `StatusTimeout` constant** — distinct from `StatusError` for timeout cases
2. **Retry logic in `querySingleType`** — 3 attempts with exponential backoff (100ms, 200ms, 400ms) for:
- Timeout / no response
- SERVFAIL
3. **No retry for authoritative negatives:**
- NXDOMAIN → `StatusNXDomain`
- NOERROR + empty answer → `StatusNoData`
4. **Structured error information** — `NameserverResponse.Error` field populated with descriptive messages for timeout and SERVFAIL
5. **New `ErrSERVFAIL` sentinel error** for proper static error handling
### Design
Refactored `querySingleType` into smaller functions (`querySingleTypeWithRetry`, `recordRetryFailure`, `handleDNSResponse`, `waitBackoff`) to keep cyclomatic complexity within limits.
`make check` passes with 0 issues — see comment below.
- Add StatusTimeout constant for timeout responses
- querySingleType now retries on timeout and SERVFAIL (3 attempts,
exponential backoff starting at 100ms)
- NXDOMAIN and NOERROR+empty are treated as authoritative negatives
with no retry
- classifyResponse sets structured error messages for timeout and
SERVFAIL cases
- Refactored into smaller functions to satisfy cyclomatic complexity
limits
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Fixes #35 — resolver now distinguishes timeout from authoritative negative responses and retries on timeout/SERVFAIL.
Changes
StatusTimeoutconstant — distinct fromStatusErrorfor timeout casesquerySingleType— 3 attempts with exponential backoff (100ms, 200ms, 400ms) for:StatusNXDomainStatusNoDataNameserverResponse.Errorfield populated with descriptive messages for timeout and SERVFAILErrSERVFAILsentinel error for proper static error handlingDesign
Refactored
querySingleTypeinto smaller functions (querySingleTypeWithRetry,recordRetryFailure,handleDNSResponse,waitBackoff) to keep cyclomatic complexity within limits.make checkpasses with 0 issues — see comment below.make checkoutputAll 30 resolver tests pass. No linter issues. Build succeeds.
Closing — superseded by #37 which is rebased against current main.
Pull request closed