Skip to content

resolver: make resolver.Endpoint and resolver.Address immutable #8773

@Pranjali-2501

Description

@Pranjali-2501

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: xDSIncludes everything xDS related, including LB policies used with xDS.P2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions