Skip to content

[Livy-1091] Upgrade libthrift 0.9.3 to 0.25.0 - #567

Open
nileshrathi345 wants to merge 2 commits into
apache:masterfrom
nileshrathi345:LIVY-1091
Open

nileshrathi345 wants to merge 2 commits into
apache:masterfrom
nileshrathi345:LIVY-1091

Conversation

@nileshrathi345

@nileshrathi345 nileshrathi345 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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

How was this patch tested?

Compile (Spark 3):
mvn -Pthriftserver -Pspark3 -Pscala-2.12 -pl thriftserver/server,thriftserver/session -am compile -DskipTests
Compile (Spark 4 / default):
mvn -Pthriftserver -pl thriftserver/server,thriftserver/session -am compile -DskipTests
Unit tests:
mvn -Pthriftserver -Pspark3 -Pscala-2.12 -pl thriftserver/session test
(ColumnBufferTest, 6 tests)

Was this patch authored or co-authored using generative AI tooling?

Co-authored by: Cursor AI

@nileshrathi345

Copy link
Copy Markdown
Contributor Author

@gyogal and @roczei
could you please take a look when possible and review
thanks..!!!!

@roczei

roczei commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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:

mvn -Pthriftserver -Pspark3 -Pscala-2.12 -B  verify
mvn -Pthriftserver -B verify

Hive JDBC 3.0 (used by Thrift HTTP integration tests) still constructs
THttpClient with Apache HttpClient 4.x:
  THttpClient(String, org.apache.http.client.HttpClient)
libthrift 0.25 only provides HttpClient 5.x constructors, which causes
NoSuchMethodError in HttpThriftServerSuite at runtime.
Add a test-scoped THttpClient under src/test/java that restores the
HttpClient 4.x constructor for the JDBC test client. The Livy Thrift
HTTP server uses ThriftHttpServlet (not libthrift TServlet/THttpClient),
so this does not change production server artifacts.
@nileshrathi345

nileshrathi345 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

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:

mvn -Pthriftserver -Pspark3 -Pscala-2.12 -B  verify
mvn -Pthriftserver -B verify

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
mvn -Pthriftserver -B verify

nilesh.rathi@HQV9WP4F7Y livy % mvn -Pthriftserver -B verify

[INFO] Rat check: Summary over all files. Unapproved: 0, unknown: 0, generated: 0, approved: 1 licenses.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Livy Project Parent POM 1.0.0-SNAPSHOT:
[INFO]
[INFO] Livy Project Parent POM ............................ SUCCESS [ 3.865 s]
[INFO] livy-api ........................................... SUCCESS [ 7.253 s]
[INFO] livy-client-common ................................. SUCCESS [ 2.935 s]
[INFO] livy-test-lib ...................................... SUCCESS [ 3.826 s]
[INFO] multi-scala-project-root ........................... SUCCESS [ 0.992 s]
[INFO] livy-core-parent ................................... SUCCESS [ 0.309 s]
[INFO] livy-core_2.13 ..................................... SUCCESS [ 1.688 s]
[INFO] livy-rsc ........................................... SUCCESS [ 31.163 s]
[INFO] livy-repl-parent ................................... SUCCESS [ 3.981 s]
[INFO] livy-repl_2.13 ..................................... SUCCESS [01:36 min]
[INFO] livy-server ........................................ SUCCESS [03:42 min]
[INFO] livy-thriftserver-session .......................... SUCCESS [ 13.825 s]
[INFO] livy-thriftserver .................................. SUCCESS [05:44 min]
[INFO] livy-assembly ...................................... SUCCESS [ 5.076 s]
[INFO] livy-client-http ................................... SUCCESS [ 13.519 s]
[INFO] livy-scala-api-parent .............................. SUCCESS [ 1.303 s]
[INFO] livy-scala-api_2.13 ................................ SUCCESS [ 21.939 s]
[INFO] livy-integration-test .............................. SUCCESS [25:58 min]
[INFO] livy-coverage-report ............................... SUCCESS [ 3.833 s]
[INFO] livy-examples ...................................... SUCCESS [ 4.560 s]
[INFO] livy-python-api .................................... SUCCESS [ 2.868 s]
[INFO] livy-beeline ....................................... SUCCESS [ 3.500 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39:09 min
[INFO] Finished at: 2026-10-13T12:25:15+05:30
[INFO] ------------------------------------------------------------------------
nilesh.rathi@HQV9WP4F7Y livy % 

nilesh.rathi@HQV9WP4F7Y livy % mvn -Pthriftserver -Pspark3 -Pscala-2.12 -B verify

[INFO] Rat check: Summary over all files. Unapproved: 0, unknown: 0, generated: 0, approved: 1 licenses.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Livy Project Parent POM 1.0.0-SNAPSHOT:
[INFO]
[INFO] Livy Project Parent POM ............................ SUCCESS [ 3.367 s]
[INFO] livy-api ........................................... SUCCESS [ 5.516 s]
[INFO] livy-client-common ................................. SUCCESS [ 3.226 s]
[INFO] livy-test-lib ...................................... SUCCESS [ 3.005 s]
[INFO] multi-scala-project-root ........................... SUCCESS [ 0.946 s]
[INFO] livy-core-parent ................................... SUCCESS [ 0.353 s]
[INFO] livy-core_2.12 ..................................... SUCCESS [ 1.505 s]
[INFO] livy-rsc ........................................... SUCCESS [ 26.984 s]
[INFO] livy-repl-parent ................................... SUCCESS [ 2.992 s]
[INFO] livy-repl_2.12 ..................................... SUCCESS [01:51 min]
[INFO] livy-server ........................................ SUCCESS [03:33 min]
[INFO] livy-thriftserver-session .......................... SUCCESS [ 12.268 s]
[INFO] livy-thriftserver .................................. SUCCESS [06:01 min]
[INFO] livy-assembly ...................................... SUCCESS [ 3.838 s]
[INFO] livy-client-http ................................... SUCCESS [ 12.382 s]
[INFO] livy-scala-api-parent .............................. SUCCESS [ 0.662 s]
[INFO] livy-scala-api_2.12 ................................ SUCCESS [ 21.920 s]
[INFO] livy-integration-test .............................. SUCCESS [19:46 min]
[INFO] livy-coverage-report ............................... SUCCESS [ 3.499 s]
[INFO] livy-examples ...................................... SUCCESS [ 4.140 s]
[INFO] livy-python-api .................................... SUCCESS [ 2.674 s]
[INFO] livy-beeline ....................................... SUCCESS [ 3.465 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33:05 min
[INFO] Finished at: 2026-10-13T11:43:35+05:30
[INFO] ------------------------------------------------------------------------
nilesh.rathi@HQV9WP4F7Y livy %

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.13%. Comparing base (fc5f238) to head (1fd8412).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #567      +/-   ##
============================================
+ Coverage     69.03%   69.13%   +0.09%     
- Complexity     1231     1232       +1     
============================================
  Files           107      107              
  Lines          6986     6979       -7     
  Branches        858      857       -1     
============================================
+ Hits           4823     4825       +2     
+ Misses         1689     1682       -7     
+ Partials        474      472       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roczei roczei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

No deployments
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.

3 participants