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

Add new classes for eliminating xds config tears #11740

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

larry-safran
Copy link
Contributor

These are unfinished, but would like to get the general shape agreed to before handling moving classes.

@larry-safran larry-safran requested a review from ejona86 December 11, 2024 02:56
@larry-safran larry-safran marked this pull request as draft December 11, 2024 02:56
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shape looks fine.

package io.grpc.xds;

public interface XdsClusterSubscriptionRegistry {
ClusterSubscription subscribeToCluster(String clusterName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ClusterSubscription is pretty useless. If we didn't have it, the caller could just pass clusterName to releaseSubscription(). ClusterSubscription could be more useful if it avoided double-release, but it doesn't look like it's intended to.

I imagine we should either just pass clusterName to release, or change subscribe to return a Closable and have it detect double-close.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposal says that "The API will return some subscription handle". Mark seemed to be designing it so that multiple things could subscribe to the same cluster. I'm not sure that is really useful, but is what I was designing for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not currently a subscription handle. I'm fine with multiple things subscribing to the same cluster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the GRPC definition of a "subscription handle"? I assumed that it meant an object that had minimal functionality and acted as a representation of the particular subscription and whose only real use was passing to cancel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to have subscribeToCluster return a Closeable which is much cleaner.

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.

2 participants