Repository navigation
[Livy-1091] Upgrade libthrift 0.9.3 to 0.25.0 and Hive to 4.0.1 for thriftserver - #567
nileshrathi345 wants to merge 2 commits into
Conversation
7509144 to
3c6eb8f
Compare
|
Hi @nileshrathi345 , Thanks for the PR! Unfortunately there is a CI failure, could you please fix it? Also, please double check locally if all unit and integration tests run without errors for both Spark 4 and Spark 3 using the following commands: |
Hi @roczei — thanks for the review. Why CI failed After moving to libthrift 0.25, HttpThriftServerSuite failed with: NoSuchMethodError: THttpClient.(String, org.apache.http.client.HttpClient) The HTTP thrift integration tests connect with Hive JDBC 3.0, which still builds the HTTP transport using Apache HttpClient 4.x and that constructor. libthrift 0.25 still has THttpClient, but it only supports HttpClient 5.x — the HttpClient 4 constructor was removed. So the class is present, but the method Hive JDBC calls is not → runtime failure when the suite opens a JDBC connection in HTTP mode. This is on the test client (JDBC driver) side. The Livy Thrift HTTP server uses our ThriftHttpServlet path, not libthrift’s THttpClient. Fix: Added a test-only org.apache.thrift.transport.THttpClient under thriftserver/server/src/test/java that restores the HttpClient 4.x constructor for the JDBC client during ITs. It is not part of the shipped server artifact. Local verification Both commands completed successfully on my side: mvn -Pthriftserver -Pspark3 -Pscala-2.12 -B verify nilesh.rathi@HQV9WP4F7Y livy % mvn -Pthriftserver -B verify |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #567 +/- ##
=============================================
- Coverage 69.03% 52.75% -16.28%
+ Complexity 1231 853 -378
=============================================
Files 107 107
Lines 6986 6979 -7
Branches 858 857 -1
=============================================
- Hits 4823 3682 -1141
- Misses 1689 2849 +1160
+ Partials 474 448 -26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1fd8412 to
fac4178
Compare
Bump libthrift to 0.25.0 (CVE-2026-43869). Adapt thriftserver for libthrift 0.25 APIs and add test-only THttpClient (HttpClient 4.x) so HttpThriftServerSuite passes with Hive JDBC on the test classpath.
fac4178 to
968b6ab
Compare
|
Thanks for your PR @nileshrathi345! Could you please use a single JIRA and use that as the PR title? The commits will be squashed during the merge and they should be in the usual format. |
cc4c604 to
46005e1
Compare
Bump hive.version from 3.0.0 to 4.0.1 so the Thrift server aligns with libthrift 0.25.0 (LIVY-1091). Hive 3.0.0 was built for libthrift 0.9.3; Hive 4.0.1 targets libthrift 0.16.0 and Java 8. - Adapt to Hive 4 APIs: commons-lang3, PasswdAuthenticationProvider.Authenticate, UploadData/DownloadData stubs with placeholder operationHandle. - hive-jdbc:standalone for beeline; hive-common/hive-serde at test scope for IT. - Test-only THttpClient (HttpClient 4.x); TLS and protocol IT coverage.
46005e1 to
5417a76
Compare
What changes were proposed in this pull request?
This PR upgrades the Livy Thrift Server dependency on org.apache.thrift:libthrift from 0.9.3 to 0.25.0 (LIVY-1091).
Motivation: Apache Thrift before 0.23.0 is affected by CVE-2026-43869 (TLS hostname verification in TSSLTransportFactory). Livy’s Thrift Server uses libthrift for binary and HTTP CLI/JDBC transport; bumping to 0.25.0 addresses that class of issues and removes a very old pinned dependency.
Jira: https://issues.apache.org/jira/browse/LIVY-1091
This PR also bumps hive.version from 3.0.0 to 4.0.1 for the Thrift server and related modules. It builds on LIVY-1091 (libthrift 0.25.0 for GHSA-7pwc-h2j2-rjgj). Hive 3.0.0 was compiled against libthrift 0.9.3; Hive 4.0.1 uses libthrift 0.16.0 and Java 8, which fits Livy's -Pspark3 / JDK 8 CI leg while Livy continues to run libthrift 0.25 on the server classpath.
commons-lang3usage,PasswdAuthenticationProvider.Authenticate(capital A in 4.0.1), and stubs forUploadData/DownloadData. Response structs requireoperationHandle; a placeholder handle is set with the unsupported status so Thrift serialization succeeds and the client connection is not dropped.hive-jdbc:standalonefor the beeline client module. For thriftserver and integration-test, the thinhive-jdbcjar is supplemented with test-scopedhive-commonandhive-serde(Hive 4.x does not pull these via Maven transitives). Do not usestandaloneon the server IT classpath—it relocates libthrift and conflicts with compile-scopedhive-service-rpc.THttpClientwith the HttpClient 4.x constructor expected by Hive JDBC when the IT JVM loadsorg.apache.thrift. The production HTTP server usesThriftHttpServlet, not libthriftTHttpClient.JIRA: https://issues.apache.org/jira/browse/LIVY-1093
Why one PR for two Jiras: LIVY-1091 (libthrift 0.25.0) and LIVY-1093 (Hive 4.0.1) are coupled for the Thrift server: Hive 3.0.0 was built against libthrift 0.9.3, while Livy must move to libthrift 0.25.0 for CVE-2026-43869. Upgrading Hive to 4.0.1 keeps service RPC, JDBC, and authentication aligned with a supported Hive line and avoids splitting two dependent upgrades across separate PRs that would not build or test cleanly in isolation.
How was this patch tested?
Compile (Spark 3):
mvn -Pthriftserver -Pspark3 -Pscala-2.12 -pl thriftserver/server,thriftserver/session -am compile -DskipTestsCompile (Spark 4 / default):
mvn -Pthriftserver -pl thriftserver/server,thriftserver/session -am compile -DskipTestsUnit tests:
mvn -Pthriftserver -Pspark3 -Pscala-2.12 -pl thriftserver/session testlivy-thriftserver: unit and integration tests, including new coverage for TLS (binary and HTTP),UploadData/DownloadData, max message size, andLibthriftHttpCompatSuite.(ColumnBufferTest, 6 tests)
Was this patch authored or co-authored using generative AI tooling?
Co-authored by: Cursor AI (Claude Opus 4.8)