Skip to content

Commit

Permalink
Using IP addresses is not a DNS failure
Browse files Browse the repository at this point in the history
When calculating publicRoot lookup results having only configured peers
with IP addreses is not a DNS failure. Instead of a 3h TTL use 60s for
IP addresses only (will be increased by backoff logic).
  • Loading branch information
karknu authored and coot committed May 7, 2024
1 parent bfebf50 commit 1226a60
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ publicRootPeersProvider tracer
!domainsIps = [(toPeerAddr ip port, pa)
| (RelayAccessAddress ip port, pa) <- Map.assocs domains ]
!ips = Map.fromList (map fst successes) `Map.union` Map.fromList domainsIps
!ttl = ttlForResults (map snd successes)
!ttl = if null lookups
then -- Not having any peers with domains configured is not
-- a DNS error.
ttlForResults [60]
else ttlForResults (map snd successes)
-- If all the lookups failed we'll return an empty set with a minimum
-- TTL, and the governor will invoke its exponential backoff.
return (ips, ttl)
Expand Down

0 comments on commit 1226a60

Please sign in to comment.