Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.4, 0.5, 0.6
-
None
-
None
Description
From the code in HiveMetaStore 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 [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.