Skip to content

Conversation

Zgoda91
Copy link

@Zgoda91 Zgoda91 commented Aug 1, 2025

implementing gRFC A65 grpc/proposal/pull/372

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Aug 6, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Aug 6, 2025
@ejona86 ejona86 self-requested a review August 6, 2025 21:54
@Zgoda91
Copy link
Author

Zgoda91 commented Aug 11, 2025

@ejona86 Could you please review this PR when you get a chance? Thanks!

@Zgoda91 Zgoda91 requested a review from kannanjgithub August 27, 2025 13:31
kannanjgithub
kannanjgithub previously approved these changes Aug 28, 2025
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Aug 28, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Aug 28, 2025
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.

One quick/important comment. But I'll need to look over this a bit more before merging.

@kannanjgithub kannanjgithub dismissed their stale review August 29, 2025 12:00

Based on Eric's comment.

@Zgoda91 Zgoda91 force-pushed the A65_mtls_creds_in_bootstrap branch from 8248816 to faaa15c Compare September 3, 2025 11:09
if (rootCertPath != null) {
try {
AdvancedTlsX509TrustManager trustManager = AdvancedTlsX509TrustManager.newBuilder().build();
trustManager.updateTrustCredentials(
Copy link
Member

Choose a reason for hiding this comment

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

This and the keymanager are returning Closeable, which needs to be called when the credentials are no longer being used. The biggest problem for this feature is managing the lifetime of the ChannelCredentials so you can call Closeable when it is no longer used. Without really looking at the code (so I could be wildly off), I'd expect the ChannelCredentials to have the same lifetime as the XdsClientImpl or the GrpcXdsTransportFactory. The trouble will be propagating through the layers, so when we shut down the transport factory we can close the Closeables created here.

Although, actually digging in some, things are actually worse because the value here (via GrpcBootstrapperImpl) is getting included in a BootstrapInfo object which in SharedXdsClientPoolProvider clearly has a longer lifetime than XdsClientImpl.

Copy link
Author

Choose a reason for hiding this comment

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

okay, got it. Thanks for the explanation. I will dig into this

new File(rootCertPath),
refreshIntervalSeconds,
TimeUnit.SECONDS,
scheduledExecutorServiceFactory.create());
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 be shutting down the executors as well, when no longer needed. We also shouldn't create two executors here; we can trivially share between the key and trust managers.

Copy link
Author

Choose a reason for hiding this comment

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

okay, will do. thanks!

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.

4 participants