Exclude httpcore5-h2, httpcore5-reactive, httpclient5 from SQL bundle to fix jar hell#5400
Merged
ahkcs merged 2 commits intoopensearch-project:feature/mustang-ppl-integrationfrom May 1, 2026
Conversation
The analytics-engine plugin bundles httpcore5-h2-5.4.jar,
httpcore5-reactive-5.4.jar, and httpclient5-5.6.jar in addition to
httpcore5-5.4.jar. The existing bundlePlugin exclusion list only covered
httpcore5-5*.jar, so the other three variants leaked into the SQL bundle
and tripped JarHell at install time when analytics-engine was already
installed:
jar hell!
class: org.apache.hc.core5.http2.H2ConnectionException
jar1: <sql>/httpcore5-h2-5.4.jar
jar2: <analytics-engine>/httpcore5-h2-5.4.jar
Adding the missing exclusions matches the existing pattern of stripping
shared jars provided by the analytics-engine extendedPlugins classloader.
Signed-off-by: Kai Huang <ahkcs@amazon.com>
Per Peter's review on opensearch-project#5400: flag the three new httpcore5/httpclient5 exclusions (and ideally the entire bundlePlugin exclusion block) for removal once analytics-engine becomes an optional dependency via the AnalyticsFrontEndExtension SPI in opensearch-project/OpenSearch#21449. Signed-off-by: Kai Huang <ahkcs@amazon.com>
RyanL1997
approved these changes
May 1, 2026
e113b7f
into
opensearch-project:feature/mustang-ppl-integration
36 checks passed
6 tasks
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.
Summary
Adds three missing jar exclusions to
plugin/build.gradle'sbundlePluginblock so the SQL plugin install no longer trips JarHell whenanalytics-engine(in versions that shiphttpcore5-h2/httpcore5-reactive/httpclient5) is co-installed.Failure being fixed
Reported by @peterzhuamazon against the latest
feature-build-opensearchdistribution:Root cause
The existing exclusion list (added by #5302 to share JARs via the analytics-engine
extendedPluginsclassloader) coveredhttpcore5-5*.jar, but thehttpcore5-*family ships in four variants — only the first was excluded:httpcore5-5.4.jarhttpcore5-5*.jar)httpcore5-h2-5.4.jarhttpcore5-reactive-5.4.jarhttpclient5-5.6.jarThe first uncovered variant trips install; the next two would trip immediately after.
Change
plugin/build.gradle— three new exclusions next to the existinghttpcore5-5*.jar:End-to-end verification
Built an OpenSearch 3.7 distro and ran
bin/opensearch-plugin installfor both bundle variants, withopensearch-job-scheduler+ a representativeanalytics-engine(one that shipshttpcore5-h2) pre-installed.Without the fix:
↑ Reproduces Peter's stack (different class — JarHell catches whichever duplicate it iterates first; same root cause).
With the fix:
Static check against the currently vendored
analytics-engine-3.7.0-SNAPSHOT.zip: zero overlapping JARs (by filename and by base name), confirming no class-level JarHell can fire for that pair.Caveats
analytics-enginebuild that's about to be vendored tomorrow may bundle additional JARs (e.g.,avatica-metrics,antlr4-runtime,icu4j,error_prone_annotations) that overlap with SQL — those would require additional exclusions. We deliberately stop here rather than over-excluding, because excluding a JAR that the new vendored zip doesn't ship would break SQL at runtime (ClassNotFoundException).AnalyticsFrontEndExtensionSPI work in Add AnalyticsFrontEndExtension SPI + AnalyticsServices bundle for analytics-engine frontend integration OpenSearch#21449, which makesanalytics-enginean optional dependency entirely.