yunzhaoy commented on code in PR #8303:
URL: https://github.com/apache/hadoop/pull/8303#discussion_r2907154031


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java:
##########
@@ -663,7 +663,17 @@ public static <InstanceT> InstanceT 
getInstanceFromReflection(String className,
     try {
       ClassLoader classLoader;
       if (conf != null) {
-        classLoader = conf.getClassLoader();
+        if (conf.getBoolean(AWS_S3_CLASSLOADER_ISOLATION,
+            DEFAULT_AWS_S3_CLASSLOADER_ISOLATION)) {
+          classLoader = conf.getClassLoader();
+        } else {
+          ClassLoader confLoader = conf.getClassLoader();
+          classLoader = (confLoader != null) ? confLoader
+              : Thread.currentThread().getContextClassLoader();
+        }
+        if (classLoader == null) {
+          classLoader = S3AUtils.class.getClassLoader();
+        }

Review Comment:
   Based on the logic 
[here](https://github.com/apache/hadoop/blob/release-3.5.0-RC0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L803-L806),
 the config.getClassLoader should never be null.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to