Skip to content

Thrift upgrade 2 - #6893

Merged
dengzhhu653 merged 17 commits into
apache:masterfrom
InvisibleProgrammer:thrift_upgrade_2
Nov 2, 2026
Merged

dengzhhu653 merged 17 commits into
apache:masterfrom
InvisibleProgrammer:thrift_upgrade_2

Conversation

@InvisibleProgrammer

@InvisibleProgrammer InvisibleProgrammer commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Upgrade Apache Thrift 0.16.0 → 0.24.0 and, as a forced consequence, migrates the HTTP transport used by the JDBC driver, HiveServer2, and the Standalone Metastore from Apache HttpComponents 4.x (org.apache.http.) to 5.x (org.apache.hc.).

What changes were proposed in this pull request?

libthrift: 0.16.0 → 0.24.0
httpclient / httpcore (4.5.13 / 4.4.13) → httpclient5 / httpcore5 (5.6.2 / 5.4.3)
All Thrift-generated code (Java, C++, PHP, Python, Ruby) has been regenerated with the 0.23.0 compiler.
fb303.thrift has been vendored into the repository (upstream Apache Thrift no longer publishes libfb303).

Why are the changes needed?

CVE-2026-43869

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests. For significant code changes, new test cases added.

@@ -148,6 +165,11 @@
this.httpAuthService = new HttpAuthService(cookieDomain, cookiePath, cookieMaxAge, isCookieSecure, AUTH_COOKIE);
}

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req, resp);
@@ -269,7 +291,7 @@
}
LOG.info("Cookie added for clientUserName " + clientUserName);
}
super.doPost(request, response);
processThriftRequest(request, response);
processor.process(inProtocolFactory.getProtocol(transport), outProtocolFactory.getProtocol(transport));
out.flush();
} catch (Exception e) {
throw new ServletException(e);
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
return ret;
}
return (req instanceof HttpUriRequest && ((HttpUriRequest)req).isAborted());
return super.retryRequest(response, executionCount, context);

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.

I think it would be better to avoid default response retries here. Retrying Thrift POSTs on 429/503 can execute queries or writes twice.

Comment thread standalone-metastore/pom.xml Resolved
import org.apache.hc.core5.http.config.Registry;
import org.apache.hc.core5.http.config.RegistryBuilder;
import org.apache.hc.core5.ssl.SSLContexts;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.thrift.transport.THttpClient;

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.

nit: Can you remove unused imports in this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing the unused import with the next commit.

Comment thread status.txt Resolved
…ttpServices (apache#5907)"

This reverts commit 4bdd0f1.

(cherry picked from commit 98e88cf)
(cherry picked from commit d3a573b95e35d494ce9814729fb08a6988c95f5d)
(cherry picked from commit 270b6e0)
(cherry picked from commit b79c98c70421ca426831043b628d15a64e810f4b)
kasakrisz and others added 3 commits October 27, 2026 17:15
(cherry picked from commit b2cf5224b82b8142784188f9b3cf700e5cbce78f)

# Conflicts:
#	.github/workflows/build.yml
(cherry picked from commit 0a854fb)
@sonarqubecloud

Copy link
Copy Markdown

@saihemanth-cloudera saihemanth-cloudera 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 +1. Will wait for extra set of eyes as this is a huge patch.

@InvisibleProgrammer
InvisibleProgrammer marked this pull request as ready for review October 28, 2026 18:05
@dengzhhu653

Copy link
Copy Markdown
Member

I don't have a good understanding of the retry in HiveConnection, but the rest(thrift changes) sounds good.

@InvisibleProgrammer

InvisibleProgrammer commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't have a good understanding of the retry in HiveConnection, but the rest(thrift changes) sounds good.

@dengzhhu653 : Thrift upgraded httpclient from 4 to 5. It is a breaking change.
Some parts of the original retry logic completely have been completely removed from httpclient so it was necessary to rewrite that to keep the original behavior.

@dengzhhu653

Copy link
Copy Markdown
Member

I don't have a good understanding of the retry in HiveConnection, but the rest(thrift changes) sounds good.

@dengzhhu653 : Thrift upgraded httpclient from 4 to 5. It is a breaking change. Some parts of the original retry logic completely have been completely removed from httpclient so it was necessary to rewrite that to keep the original behavior.

Sounds like HiveConnection(SAML) is the only place where has the incompatible issue, other old clients can still speak with HS2/HMS, right?

@InvisibleProgrammer

Copy link
Copy Markdown
Contributor Author

I don't have a good understanding of the retry in HiveConnection, but the rest(thrift changes) sounds good.

@dengzhhu653 : Thrift upgraded httpclient from 4 to 5. It is a breaking change. Some parts of the original retry logic completely have been completely removed from httpclient so it was necessary to rewrite that to keep the original behavior.

Sounds like HiveConnection(SAML) is the only place where has the incompatible issue, other old clients can still speak with HS2/HMS, right?

Yes. We are testing it actively on downstream. Didn't have a failure so far.

@dengzhhu653
dengzhhu653 merged commit 71c70f1 into apache:master Nov 2, 2026
5 of 6 checks passed
@InvisibleProgrammer
InvisibleProgrammer deleted the thrift_upgrade_2 branch November 11, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants