Skip to content

ATLAS-3092: Atlas Plugin ClassLoader Doesn't Restore Thread ClassLoader#32

Closed
rajkrrsingh wants to merge 1 commit intoapache:masterfrom
rajkrrsingh:ATLAS-3092
Closed

ATLAS-3092: Atlas Plugin ClassLoader Doesn't Restore Thread ClassLoader#32
rajkrrsingh wants to merge 1 commit intoapache:masterfrom
rajkrrsingh:ATLAS-3092

Conversation

@rajkrrsingh
Copy link
Copy Markdown

PROBLEM: Atlas Plugin ClassLoader's MyComponent parent always set to UDFClassLoader after hiveserver2 start even though it is closed, Hiveserver2 can run sessions concurrently with different sessionstate, so if the sessionstate disgraded and associated UDF classloader is closed, MyComponent parent loader still has this closed parent classloader. this can yield into the CNF exception for custom hive udf.

Fix: In this proposed fix, during activate call I am storing current classloader in prevClassloader and during deactivate checking if the plugintype is hive( don't want to break the other components) then setting the Thread current class loader back to the previous one.

Test: Run few test on my reproduce where hive custom udf were failing due to CNF which are succeeded now.

LOG.debug("==> AtlasPluginClassLoader.activate()");
}

previousLoader = Thread.currentThread().getContextClassLoader();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AtlasPluginClassLoader instance could be used in multiple threads simultaneously. So, saving 'previousLoader' in an instance member is not a safe option. @RMani (Ramesh Mani) is working on addressing the same issue in Ranger via RANGER-2376. I would suggest to wait for his Ranger fix and apply the same in Atlas as well.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be safe to save it on a per thread basis then?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just handling this in the HiveHook it self? Then it should all be in the same thread and would be hive specific.

@nixonrodrigues
Copy link
Copy Markdown
Collaborator

This issue is resolved in ATLAS-3092 and fix is merged, so closing the PR.
Thanks @rajkrrsingh for PR and @shawnweeks @mneethiraj for reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants