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

Thejas M Nair commented on HIVE-4574:
-------------------------------------

With latest version of code (post HIVE-4825 ), in Utilities.java looks like we 
need the synchronization in only two functions - serializeObject  and 
serializeExpression .

Regarding deserialization calls, I haven't traced openjdk call hierarchy for 
that. But the culprit (com.sun.beans.finder.MethodFinder.findMethod) seems to 
be a call that might be used in deserialization call path as well. Also, I 
don't have much faith remaining in the overall thread safety of this part of 
the code. As the  deserialization calls (deserializeExpression, 
deserializeObject) are called from client side, it would be safer to 
synchronize them (until of course HIVE-1511 removes use of XMLEncoder)

PTFUtils class is also using XMLEncoder, but those function that uses them 
don't seem to get used anywhere (PTFUtils.serialize) .

                
> XMLEncoder thread safety issues in openjdk7 causes HiveServer2 to be stuck
> --------------------------------------------------------------------------
>
>                 Key: HIVE-4574
>                 URL: https://issues.apache.org/jira/browse/HIVE-4574
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 0.11.0
>            Reporter: Thejas M Nair
>            Assignee: Thejas M Nair
>         Attachments: HIVE-4574.1.patch
>
>
> In open jdk7, XMLEncoder.writeObject call leads to calls to 
> java.beans.MethodFinder.findMethod(). MethodFinder class not thread safe 
> because it uses a static WeakHashMap that would get used from multiple 
> threads. See -
> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/com/sun/beans/finder/MethodFinder.java#46
> Concurrent access to HashMap implementation that are not thread safe can 
> sometimes result in infinite-loops and other problems. If jdk7 is in use, it 
> makes sense to synchronize calls to XMLEncoder.writeObject .

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to