Skip to content

Conversation

@dapengzhang0
Copy link
Contributor

See go/java-xds-client-api-for-federation for detailed description

parsedResources.put(routeConfigName, new ParsedResource(rdsUpdate, resource));
}
getLogger().log(XdsLogLevel.INFO,
logger.log(XdsLogLevel.INFO,
Copy link
Member

Choose a reason for hiding this comment

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

log the serverInfo target as well? same all other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I add serverInfo info in the logger of AbstractXdsClient.

restartTimer();
}

// TODO(zdapeng): add resourceName arg and support xdstp:// resources
Copy link
Member

Choose a reason for hiding this comment

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

For LDS, we will need to parse resourceName and lookup authority in bootstrapInfo to decide the serverInfo, right?
For other xds resources, is your current implementation sufficient to decide which serverInfo to use?

Copy link
Contributor Author

@dapengzhang0 dapengzhang0 Oct 29, 2021

Choose a reason for hiding this comment

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

The watcher will parse the resource name and get the authority
https://github.com/grpc/proposal/blob/9d1e77ff3103c5dac71eabcda4269f52764518b3/A47-xds-federation.md#watcher-changes

If the resource is not cached, it will getOrCreate a XdsChannel from the serverChannelMap (I'm not 100% sure how it will work for the case of xds server fail over in the future) and send a request.

Copy link
Member

Choose a reason for hiding this comment

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

Yea the watcher change look up and lazy creating the channel makes sense.

You obviously discarded the two level map for resource cache implementation suggestion. The authority is actually included in resource name, but it is not the way gRFC suggested.
It is not a problem for now, not sure if it is a problem for server failover, or each authority can specify a list of servers, ordered by priority feature. Not a big concern for me for now.


@Override
protected void handleShutdown() {
void shutdown() {
Copy link
Member

Choose a reason for hiding this comment

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

not running in sync context? previously it was. It might race with creating AbstractXdsClient.
It looks isShutdown() is not checked anywhere?

Copy link
Contributor Author

@dapengzhang0 dapengzhang0 Oct 29, 2021

Choose a reason for hiding this comment

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

Good catch. Should run in sync context. Yeah isShutdown() is only used for test.

@dapengzhang0 dapengzhang0 merged commit a46560e into grpc:master Nov 1, 2021
@dapengzhang0 dapengzhang0 deleted the xds-client-for-fed branch November 1, 2021 16:45
beatrausch pushed a commit to beatrausch/grpc-java that referenced this pull request Nov 4, 2021
See go/java-xds-client-api-for-federation for detailed description
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants