Skip to content

HADOOP-19833. Fix fs.s3a.classloader.isolation=false by using classlo…#8303

Open
deepujain wants to merge 4 commits intoapache:trunkfrom
deepujain:HADOOP-19833-fix-classloader-isolation-config
Open

HADOOP-19833. Fix fs.s3a.classloader.isolation=false by using classlo…#8303
deepujain wants to merge 4 commits intoapache:trunkfrom
deepujain:HADOOP-19833-fix-classloader-isolation-config

Conversation

@deepujain
Copy link

@deepujain deepujain commented Mar 7, 2026

PR description — copy into GitHub when opening the PR (do not commit this file)

HADOOP-19833. Fix fs.s3a.classloader.isolation=false by using classloader from Configuration in getInstanceFromReflection

Problem

The configuration fs.s3a.classloader.isolation=false (introduced in HADOOP-18993) does not work as intended. The isolation flag is stored correctly in the Hadoop Configuration, but when creating instances via S3AUtils.getInstanceFromReflection, the classloader was always taken from conf.getClassLoader() without considering the isolation flag. When isolation is disabled, the Configuration may not have had its classloader set (e.g. maybeIsolateClassloader does not set it when isolation=false), so we must explicitly respect the flag and, when isolation is false, use the Configuration's classloader when set, otherwise the thread context classloader so that loading is not forced to use an isolated S3A classloader.

Change

In S3AUtils.getInstanceFromReflection:

  • When conf != null and fs.s3a.classloader.isolation is true (default): keep using conf.getClassLoader() (set by maybeIsolateClassloader to the S3A classloader).
  • When conf != null and fs.s3a.classloader.isolation is false: use the classloader from the Configuration (conf.getClassLoader()); if that is null, use Thread.currentThread().getContextClassLoader() so that classes are loaded from the application classpath.
  • If the resolved classloader is still null, fall back to S3AUtils.class.getClassLoader() for backward compatibility.

This ensures that when users set fs.s3a.classloader.isolation=false, instance creation uses the Configuration's classloader (or the context classloader) instead of always using the S3A isolated classloader.

Why no new tests

Existing test ITestS3AFileSystemIsolatedClassloader already validates isolation=true and isolation=false; the fix aligns runtime behavior with that test’s expectations. No new tests needed.

JIRA

Fixes HADOOP-19833

…ader from Configuration in getInstanceFromReflection.

When isolation is false, use conf.getClassLoader(); if null use thread context classloader so instance creation respects non-isolated loading.
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 18m 46s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 50m 24s trunk passed
+1 💚 compile 1m 8s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 1m 2s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 0s trunk passed
+1 💚 mvnsite 1m 14s trunk passed
+1 💚 javadoc 0m 57s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 1m 8s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 2m 44s trunk passed
+1 💚 shadedclient 37m 26s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 45s the patch passed
+1 💚 compile 0m 42s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 42s the patch passed
+1 💚 compile 0m 41s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 41s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 32s the patch passed
+1 💚 mvnsite 0m 49s the patch passed
+1 💚 javadoc 0m 31s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 32s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 35s the patch passed
+1 💚 shadedclient 33m 45s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 3s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 37s The patch does not generate ASF License warnings.
161m 19s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/1/artifact/out/Dockerfile
GITHUB PR #8303
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 82ecd42d922b 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 72bf011
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/1/testReport/
Max. process+thread count 583 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aws U: hadoop-tools/hadoop-aws
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/1/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 55s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 49m 29s trunk passed
+1 💚 compile 1m 12s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 compile 1m 24s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 checkstyle 1m 5s trunk passed
+1 💚 mvnsite 1m 9s trunk passed
+1 💚 javadoc 0m 57s trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 53s trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 45s trunk passed
+1 💚 shadedclient 35m 45s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 44s the patch passed
+1 💚 compile 0m 39s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javac 0m 39s the patch passed
+1 💚 compile 0m 43s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 javac 0m 43s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 28s the patch passed
+1 💚 mvnsite 0m 47s the patch passed
+1 💚 javadoc 0m 30s the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04
+1 💚 javadoc 0m 30s the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1
+1 💚 spotbugs 1m 29s the patch passed
+1 💚 shadedclient 34m 59s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 4m 47s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 35s The patch does not generate ASF License warnings.
142m 57s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/2/artifact/out/Dockerfile
GITHUB PR #8303
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 9af70a14d4e2 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e98c38c
Default Java Ubuntu-17.0.18+8-Ubuntu-124.04.1
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/2/testReport/
Max. process+thread count 570 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aws U: hadoop-tools/hadoop-aws
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8303/2/console
versions git=2.43.0 maven=3.9.11 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

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.

2 participants