[jira] [Commented] (HIVE-21409) Initial SessionState ClassLoader Reused For Subsequent Sessions

2019-03-20 Thread Shawn Weeks (JIRA)


[ 
https://issues.apache.org/jira/browse/HIVE-21409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16796834#comment-16796834
 ] 

Shawn Weeks commented on HIVE-21409:


So far I've identified that the Apache Atlas Hook and the RangerHiveAuthorizer 
are both modify the current threads classloader without consideration for the 
current threads existing classloader. It probably wouldn't be an issue if they 
were just adding to the classloader but it looks like they're completely 
replacing it with one from another session.

> Initial SessionState ClassLoader Reused For Subsequent Sessions
> ---
>
> Key: HIVE-21409
> URL: https://issues.apache.org/jira/browse/HIVE-21409
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: Shawn Weeks
>Priority: Minor
> Attachments: create_class.sql, run.sql, setup.sql
>
>
> It appears that the first ClassLoader attached to a SessionState Static 
> Instance is being reused as the parent for all future sessions. This causes 
> any libraries added to the class path on the initial session to be added to 
> future sessions. It also appears that further sessions may be adding jars to 
> this initial ClassLoader as well leading to the class path getting more and 
> more polluted. This occurring on a build including HIVE-11878. I've included 
> some examples that greatly exaggerate the problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HIVE-21409) Initial SessionState ClassLoader Reused For Subsequent Sessions

2019-03-19 Thread Shawn Weeks (JIRA)


[ 
https://issues.apache.org/jira/browse/HIVE-21409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16796783#comment-16796783
 ] 

Shawn Weeks commented on HIVE-21409:


I've spent a lot of time tracking this down and I've run into a dead end with a 
call to ReflectionUtils in HiveUtils.

getAuthorizerFactory. For some reason this call is changing the class loader 
for the current thread.

> Initial SessionState ClassLoader Reused For Subsequent Sessions
> ---
>
> Key: HIVE-21409
> URL: https://issues.apache.org/jira/browse/HIVE-21409
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: Shawn Weeks
>Priority: Minor
> Attachments: create_class.sql, run.sql, setup.sql
>
>
> It appears that the first ClassLoader attached to a SessionState Static 
> Instance is being reused as the parent for all future sessions. This causes 
> any libraries added to the class path on the initial session to be added to 
> future sessions. It also appears that further sessions may be adding jars to 
> this initial ClassLoader as well leading to the class path getting more and 
> more polluted. This occurring on a build including HIVE-11878. I've included 
> some examples that greatly exaggerate the problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HIVE-21409) Initial SessionState ClassLoader Reused For Subsequent Sessions

2019-03-18 Thread Shawn Weeks (JIRA)


[ 
https://issues.apache.org/jira/browse/HIVE-21409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16795587#comment-16795587
 ] 

Shawn Weeks commented on HIVE-21409:


I've verified this bug in Hive 3.1 as well. A combination of Add Jar and 
implicitly added UDF Jars pollute the session classloader.

> Initial SessionState ClassLoader Reused For Subsequent Sessions
> ---
>
> Key: HIVE-21409
> URL: https://issues.apache.org/jira/browse/HIVE-21409
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: Shawn Weeks
>Priority: Minor
> Attachments: create_class.sql, run.sql, setup.sql
>
>
> It appears that the first ClassLoader attached to a SessionState Static 
> Instance is being reused as the parent for all future sessions. This causes 
> any libraries added to the class path on the initial session to be added to 
> future sessions. It also appears that further sessions may be adding jars to 
> this initial ClassLoader as well leading to the class path getting more and 
> more polluted. This occurring on a build including HIVE-11878. I've included 
> some examples that greatly exaggerate the problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (HIVE-21409) Initial SessionState ClassLoader Reused For Subsequent Sessions

2019-03-08 Thread Shawn Weeks (JIRA)


[ 
https://issues.apache.org/jira/browse/HIVE-21409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16788350#comment-16788350
 ] 

Shawn Weeks commented on HIVE-21409:


I've changed registerJars in SessionState to get the classLoader from 
SessionState.getConf().getClassLoader() instead of the thread context and it 
seems to have cleared up the class loader pollution. Not 100% sure what it's 
doing or why the thread context at that point doesn't already have the session 
state's class loader.

> Initial SessionState ClassLoader Reused For Subsequent Sessions
> ---
>
> Key: HIVE-21409
> URL: https://issues.apache.org/jira/browse/HIVE-21409
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: Shawn Weeks
>Priority: Minor
> Attachments: create_class.sql, run.sql, setup.sql
>
>
> It appears that the first ClassLoader attached to a SessionState Static 
> Instance is being reused as the parent for all future sessions. This causes 
> any libraries added to the class path on the initial session to be added to 
> future sessions. It also appears that further sessions may be adding jars to 
> this initial ClassLoader as well leading to the class path getting more and 
> more polluted. This occurring on a build including HIVE-11878. I've included 
> some examples that greatly exaggerate the problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)