Respect SSL Provider for GrpcQueryServer in support of RenewableTlsUtils#17760
Open
AlexanderKM wants to merge 1 commit intoapache:masterfrom
Open
Respect SSL Provider for GrpcQueryServer in support of RenewableTlsUtils#17760AlexanderKM wants to merge 1 commit intoapache:masterfrom
AlexanderKM wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17760 +/- ##
============================================
- Coverage 63.21% 63.18% -0.03%
Complexity 1454 1454
============================================
Files 3179 3179
Lines 191279 191282 +3
Branches 29251 29252 +1
============================================
- Hits 120909 120870 -39
- Misses 60930 60973 +43
+ Partials 9440 9439 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Alex Maniates <maniatesa@gmail.com>
9d72220 to
0899e8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
We have observed that MSE queries start failing after some time (30 days+ when our internal certs expire)
snippet of example error:
After some digging, it looks like there is a mismatch in the way Pinot is setting the SSL Provider for GRPC connections (i.e. connections for MSE queries).
The Fix
We can take inspiration from the BaseGrpcQueryClient
Note, that when the sslProvider is not null, we want to explicitly call
GrpcSslContexts.configure(sslContextBuilder, SslProvider.valueOf(tlsConfig.getSslProvider()));.When the call
GrpcSslContexts.configure(sslContextBuilder);is made without the explicit sslProvider,this silently uses the default ssl provider, OpenSSL, with this code:
[source here]
So even when we were building and setting the ssl provider, it is essentially skipped later.
Thus, the fix here is to mimic the grpc client code, and always call
GrpcSslContexts.configure(sslContextBuilder, sslProvider).The big root cause is that the default OpenSSL provider only loads the raw key bytes and cert bytes ONCE into native memory, and does not reload them later. The JDK provider stores references to the KeyManager and TrustManager objects, which can be refreshed in the background to support the reload use case from RenewableTlsUtils
Testing
Confirmed the MSE queries work with our deployments 👍
Tagging @xiangfu0 since I've seen some recent PRs related to this type of code
#17358
#17559