erldns icon indicating copy to clipboard operation
erldns copied to clipboard

Possible race condition in `zone_cache:put_zone/1`?

Open g-andrade opened this issue 2 years ago • 2 comments

Hi,

I've been using erldns 2.2.0 as a library (great library, by the way!)

I happened to take a look into erldns_zone_cache:put_zone/1 and, if the cache works the way I superficially understood it to, there appears to be race condition between invoking delete_zone_records/1 and put_zone/2. https://github.com/dnsimple/erldns/blob/97d2b8ec029f89eec4adb5f49af6d241d457bf86/src/erldns_zone_cache.erl#L277-L283

Did I understood it correctly? Is there a tiny window where lookups might fail every time put_zone/1 is used? If so, would you be open to changing the order between calls? I'd be available for a PR.

Thanks!

g-andrade avatar Nov 10 '21 19:11 g-andrade

(Bump)

g-andrade avatar Jan 07 '22 21:01 g-andrade

(Bump 🥺)

g-andrade avatar Sep 29 '22 16:09 g-andrade