-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Currently, resolver.Endpoint and resolver.Address are mutable structs. This poses a significant risk of data races and was identified during the review of PR #8750. As we move towards passing EDS updates around as lists of resolver.Endpoint, immutability is required to safely share these resources without complex manual copying logic at every call site.
Currently developers manually clone the resolver.Endpoint and its Addresses slice before modification to avoid races.
Refactor the resolver package and related attribute-handling functions to treat resolver.Endpoint and resolver.Address as immutable values.
Helper functions that currently modify attributes should be updated to return a new copy of the endpoint/address with the updated attributes, rather than mutating the input argument.