Skip to content

Conversation

larry-safran
Copy link
Contributor

@larry-safran larry-safran commented Aug 21, 2024

Split off from #11254

@Rule
public final ExpectedException thrown = ExpectedException.none();
private final Node node = Node.newBuilder().setId("SharedXdsClientPoolProviderTest").build();
private static final String DUMMY_TARGET = "dummy";
Copy link
Member

Choose a reason for hiding this comment

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

We should test at least two targets, and verify, e.g. the second xdsClient is not the same instance as the first one, is ref counted.

Copy link
Member

Choose a reason for hiding this comment

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

I see that multiple targets have been covered in csds service test. Still, it would be nice to have multiple targets tested in this UT.

String resourceType = value.getTypeUrl();
if (!value.getResponseNonce().isEmpty()
&& !String.valueOf(xdsNonces.get(resourceType)).equals(value.getResponseNonce())) {
if (!value.getResponseNonce().isEmpty() && xdsNonces.containsKey(resourceType)
Copy link
Member

Choose a reason for hiding this comment

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

this change also seems not related?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fix is needed to support anything trying a nonce other than the initial empty value.

Copy link
Member

Choose a reason for hiding this comment

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

I still don't see this change related to "support multiple xds client". Looks this file can be reverted without impacting anything?
But I see this potentially avoid NPE when it receives another resource type other than the hardcoded resource type in xdsNonces keyset.

Copy link
Member

@YifeiZhuang YifeiZhuang left a comment

Choose a reason for hiding this comment

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

LGTM in general with two minor comments.

@Rule
public final ExpectedException thrown = ExpectedException.none();
private final Node node = Node.newBuilder().setId("SharedXdsClientPoolProviderTest").build();
private static final String DUMMY_TARGET = "dummy";
Copy link
Member

Choose a reason for hiding this comment

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

I see that multiple targets have been covered in csds service test. Still, it would be nice to have multiple targets tested in this UT.

TimeProvider.SYSTEM_TIME_PROVIDER,
MessagePrinter.INSTANCE,
new TlsContextManagerImpl(bootstrapInfo));
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

What is this catching? I don't see any new exceptions in #11254 either.

@ejona86
Copy link
Member

ejona86 commented Aug 23, 2024

You don't need to wait for me to merge this. I wasn't planning on providing a full review. I just poked in and had the drive-by comment.

@larry-safran larry-safran merged commit d034a56 into grpc:master Aug 23, 2024
@larry-safran larry-safran deleted the xds_client_split branch August 23, 2024 20:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants