aditya-gupta36 commented on code in PR #640:
URL: https://github.com/apache/atlas/pull/640#discussion_r3534585413
##########
addons/hbase-bridge/pom.xml:
##########
@@ -297,6 +415,20 @@
<build>
<plugins>
+ <!-- Parent disables Failsafe forking (forkCount=0). Fork IT JVM
for stable Atlas client + Hadoop minicluster. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
Review Comment:
Why maven-failsafe-plugin?
The parent POM sets forkCount=0, so all ITs run inside the Maven JVM with
one mixed classpath. After the Jersey 2 upgrade, bridge ITs hit classpath
conflicts: shaded atlas-client-v2-shaded (relocated JAX-RS →
NoSuchMethodError), duplicate Jackson providers, and Hive changing the thread
context class loader during SessionState.start().
We override Failsafe per module with forkCount=1, reuseForks=false, and
targeted classpathDependencyExcludes. Without these overrides, CI shows
failures like LinkageError on ClientBuilder, shaded...RuntimeType
NoSuchMethodError, and (on JDK 17) AppClassLoader cannot be cast to
URLClassLoader in Hive ITs.
Classloader issue — why it exists?
"Class loader casting to URLClassLoader succeeds in Java 8 but fails in Java
9+ due to the internal modularity changes; the modern application class loader
(jdk.internal.loader.ClassLoaders$AppClassLoader) no longer extends
URLClassLoader."
Why HiveITSystemClassLoader.java was added?
A custom system class loader installed at JVM startup so Hive’s
SessionState.class.getClassLoader() returns a real URLClassLoader:
ITs also call SessionState.start() via the same Hive 3.1.3 code path. On JDK
17, Hive unconditionally casts SessionState.class.getClassLoader() to
URLClassLoader. The default JDK 9+ app loader is not a URLClassLoader, so
@BeforeClass setUp() fails before any test runs.
HiveITSystemClassLoader is a test-only system class loader (via
-Djava.system.class.loader) that makes that cast succeed. It is activated only
on JDK 9+ through the hive-it-jdk17 profile and requires forkCount=1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]