[
https://issues.apache.org/jira/browse/HCATALOG-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13652125#comment-13652125
]
Mithun Radhakrishnan commented on HCATALOG-627:
-----------------------------------------------
Certainly, Alan. Would it be preferable to roll this back, and wait for
branch-11 to be cut before checking this into trunk?
> NotificationListener is not thread safe
> ---------------------------------------
>
> Key: HCATALOG-627
> URL: https://issues.apache.org/jira/browse/HCATALOG-627
> Project: HCatalog
> Issue Type: Bug
> Affects Versions: 0.4, 0.5, 0.6
> Reporter: Arup Malakar
> Assignee: Arup Malakar
> Fix For: hive-0.12
>
> Attachments: HCATALOG-627-branch-0.5-0.patch,
> HCATALOG-627-branch-0.5-1.patch, HCATALOG-627-branch-0.5-2.patch,
> HCATALOG-627-branch-0.5-3.patch, HCATALOG-627-trunk-0.patch,
> HCATALOG-627-trunk-1.patch, HCATALOG-627-trunk-2.patch,
> HCATALOG-627-trunk-3.patch
>
>
> From the code in
> [HiveMetaStore|http://svn.apache.org/repos/asf/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java]
> it appears that only one instance of the provided listener is created which
> then gets used by the thread pool. But the methods in the
> NotificationListnener in HCatalog is not threadsafe. For example according to
> JMS api documentation a Connection object can be shared among threads, but
> the [Session|http://docs.oracle.com/javaee/1.4/api/javax/jms/Session.html]
> [1] object should be specific to a thread.
> | A Session object is a single-threaded context for producing and consuming
> messages. Although it may allocate provider resources outside the Java
> virtual machine (JVM), it is considered a lightweight JMS object.
> But NotificationListener has only one session object which gets shared among
> threads. While testing I have observed cases where messages were getting
> drooped, using a ThreadLocal Session solved the problem for me. But I am
> interested in knowing if anyone else has seen dropped messages.
--
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