fix: respect TlsSpec for segment push client#18530
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18530 +/- ##
============================================
- Coverage 63.73% 56.75% -6.98%
+ Complexity 1932 7 -1925
============================================
Files 3292 2567 -725
Lines 201471 148983 -52488
Branches 31317 24100 -7217
============================================
- Hits 128398 84558 -43840
+ Misses 62787 57241 -5546
+ Partials 10286 7184 -3102
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:
|
| assertSame(SegmentPushUtils.getFileUploadDownloadClient(defaultJobSpec), defaultClient); | ||
|
|
||
| SegmentGenerationJobSpec tlsJobSpec = new SegmentGenerationJobSpec(); | ||
| tlsJobSpec.setTlsSpec(new TlsSpec()); |
There was a problem hiding this comment.
This test doesn't test anything ;)
You need to add a test with a custom truststore/keystore, ideally against a local HTTPS endpoint that fails with the default client and succeeds through SegmentPushUtils with TlsSpec.
0b92350 to
30a8421
Compare
Summary
FileUploadDownloadClientfromSegmentGenerationJobSpec.getTlsSpec()for segment push pathsTlsSpecTlsUtils.createSslContext(...)so callers can build anSSLContextwithout mutating JVM-wide HTTPS defaultsRoot Cause
SegmentPushUtilsalways used a staticFileUploadDownloadClient, so push jobs that suppliedTlsSpecdid not build a client from that job-level TLS configuration. Direct/core/Hadoop segment push flows could therefore ignore the intended key/trust store settings.Fixes #17702
Tests
JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@21/bin:$PATH ./mvnw -pl pinot-segment-local -am -Dtest=org.apache.pinot.segment.local.utils.SegmentPushUtilsTest#testGetFileUploadDownloadClientHonorsTlsSpec -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false testfailed becauseSegmentPushUtils.getFileUploadDownloadClient(...)did not exist yet.JAVA_HOME=/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@21/bin:$PATH ./mvnw -pl pinot-common,pinot-segment-local -am -Dtest=org.apache.pinot.common.utils.tls.TlsUtilsTest,org.apache.pinot.segment.local.utils.SegmentPushUtilsTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false testgit diff --check upstream/master...HEAD