Shekharrajak commented on code in PR #19497:
URL: https://github.com/apache/druid/pull/19497#discussion_r3283245141
##########
extensions-core/orc-extensions/src/main/java/org/apache/druid/data/input/orc/OrcInputFormat.java:
##########
@@ -55,14 +57,15 @@ public OrcInputFormat(
this.conf = conf;
}
- private void initialize(Configuration conf)
+ // Ensure FileSystem class-level initialization happens with the correct
classloader (see #1714).
+ // Called once on first createReader() via AtomicBoolean guard to prevent a
race when multiple
+ // subtasks concurrently swap Thread.currentThread().setContextClassLoader()
(see #19491).
+ private void ensureFileSystemInitialized()
{
- //Initializing seperately since during eager initialization, resolving
- //namenode hostname throws an error if nodes are ephemeral
-
- // Ensure that FileSystem class level initialization happens with correct
CL
- // See https://github.com/apache/druid/issues/1714
- ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader();
+ if (!fileSystemInitialized.compareAndSet(false, true)) {
Review Comment:
Thanks for checking reseting
https://github.com/apache/druid/pull/19497/changes/1b300994c0eda1275169dc878461d8974d13d260#diff-8f129e69b5d986ba1793e9ec079452a0722b8012b8521a03f77716e94f500153R75
--
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]