dnscontrol/providers/route53
Jakob Ackermann 7b81878a49
ROUTE53: make caching of zones thread-safe (#3328)
Hi @tresni!
While reviewing all the `ZoneCreator` implementations, I noticed that
the ROUTE53 provider has an unsafe caching implementation for zones and
`EnsureZoneExists` has a race-condition bug. `EnsureZoneExists` resets
the cache before making the API call for creating a given zone. This
might run concurrently to the processing of other zones and in turn
could result in unexpected behavior: the cache could get re-populated
before the creation of the zone completes and the new zone could be
missing from the newly populated cache. This PR is making all access to
the zone cache thread-safe and fixing the aforementioned race-condition.
Would you mind giving this a try and let me know how it goes? Thanks!

Bonus: The zone cache is no longer reset when creating zones. Instead,
the cache is populated with the zone that is included in the API
response from creating the zone.

Part of https://github.com/StackExchange/dnscontrol/issues/3007
2025-12-03 08:35:24 -05:00
..
auditrecords.go CHORE: Fix lint warnings from golangci-lint (#3311) 2025-01-13 11:33:12 -05:00
route53Provider.go ROUTE53: make caching of zones thread-safe (#3328) 2025-12-03 08:35:24 -05:00
route53Provider_test.go CHORE: Fix lint warnings from golangci-lint (#3311) 2025-01-13 11:33:12 -05:00