[
https://issues.apache.org/jira/browse/HCATALOG-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Arup Malakar updated HCATALOG-627:
----------------------------------
Attachment: HCATALOG-627-trunk-0.patch
Changes:
1. Added threadlocal for session variables
2. Added health check for connection
3. Exposed retry in a cleaner way and retry is done from only one place
4. Moved creation of topic/session etc so, that users can override them for
their JMS vendor if they wish to
5. Connection close is sufficient and session close could be omitted
> 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
> Attachments: HCATALOG-627-trunk-0.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