[ https://issues.apache.org/jira/browse/HIVE-7409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14064638#comment-14064638 ]
Tsuyoshi OZAWA commented on HIVE-7409: -------------------------------------- [~xuefuz] and [~navis], [JDK-7171421|https://bugs.openjdk.java.net/browse/JDK-7171421] is correct way which reproduce deadlock: 1. Thread 1: {{Class.getAnnotations}} or {{Class.getAnnotation}} -> {{initAnnotationsIfNecessary(synchronized)}} -> {{AnnotationType.getInstance(synchronized)}} 2. Thread 2: {{AnnotationType.getInstance(synchronized)}} -> {{Class.getAnnotation}} -> {{initAnnotationsIfNecessary(synchronized)}} This is deadlock between {{Class.getAnnotations}} and{{AnnotationType.getInstance}}. JDK-side fix will be merged on future release - [JDK-8047613|https://bugs.openjdk.java.net/browse/JDK-8047613]. Do you have additional questions? > Add workaround for a deadlock issue of Class.getAnnotation() > ------------------------------------------------------------- > > Key: HIVE-7409 > URL: https://issues.apache.org/jira/browse/HIVE-7409 > Project: Hive > Issue Type: Bug > Reporter: Tsuyoshi OZAWA > Assignee: Tsuyoshi OZAWA > Attachments: HIVE-7409.1.patch, HIVE-7409.2.patch.txt, stacktrace.txt > > > [JDK-7122142|https://bugs.openjdk.java.net/browse/JDK-7122142] mentions that > there is a race condition in getAnnotations. This problem can lead deadlock. > The fix on JDK will be merged on jdk8, but hive supports jdk6/jdk7 currently. > Therefore, we should add workaround to avoid the issue. -- This message was sent by Atlassian JIRA (v6.2#6252)