Open barrucadu opened 2 years ago
This isn't just a problem with 0-TTL records. If resolving a record requires more records to be cached than the cache can hold, it will get stuck in a loop.
So we do need a sort of request-local cache, in addition to the shared cache. The request-local cache would hold everything, with inserts pushing records of TTL > 0 into the shared cache.
RFC 1035 says:
Currently the only way intermediary RRs get used is by sticking them in the cache. So if an essential record has a TTL of zero,
resolved
will fail to make use of it: it will look up that record every time it needs it, and I wouldn't be surprised if this could cause an infinite loop in some cases.I think the way to solve this is to have an additional transaction-local cache inside the
SharedCache
, which only stores RRs with a TTL of zero.