-
-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Description
Problem
When expireAction == Refresh, a host that fails DNS resolution is retried every unknownHostTtl (default 1 minute) indefinitely. Each retry consumes a semaphore permit and makes a blocking system DNS call. For hosts that will never resolve, this wastes resources forever.
Proposal
Add a max retry count to CachingResolver. After a configurable number of consecutive failed refreshes, the entry would be dropped from the cache instead of being retried.
This would require:
- A new
failureCountfield onCacheEntry, incremented inrefreshOrDropEntrieseach time a failed entry is refreshed - A new
maxRetriesconfig field inDnsResolver.Config(with a sensible default) - When
failureCount >= maxRetries, drop the entry regardless ofexpireAction
Alternatives
- Max failure TTL: Track when the host first started failing and drop after a duration ceiling. Similar complexity (new field on
CacheEntry) but uses time rather than count. - Exponential backoff: Progressively increase the retry interval. Reduces resource usage without a hard cutoff, but adds complexity.
@987Nabil Which solution do you prefer?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels