Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-js-xds: Reference clusters for ConfigSelector lifetime #2883

Merged

Conversation

murgatroid99
Copy link
Member

First, this modifies the ConfigSelector API to make it an object instead of a function. The object has an invoke method, which is called the same way the function was previously called, and an additional unref function, which signals the end of the lifetime of the ConfigSelector. This allows resolvers to track and act on the lifetime of the ConfigSelector.

Second, this modifies the xDS resolver so that it keeps a cluster ref for each cluster that a ConfigSelector can select, for the lifetime of the ConfigSelector, plus an additional ref for each call for which a cluster has been selected, until that call is committed. This ensures that once a ConfigSelector is created, every cluster it can select will be subscribed to continuously until no more calls need it.

@murgatroid99 murgatroid99 merged commit 5a942ed into grpc:master Jan 15, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant