Uploaded image for project: 'HCatalog'
  1. HCatalog
  2. HCATALOG-627

NotificationListener is not thread safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.4, 0.5, 0.6
    • Fix Version/s: hive-0.12
    • Component/s: None
    • Labels:
      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.

        Attachments

        1. HCATALOG-627-trunk-3.patch
          12 kB
          Arup Malakar
        2. HCATALOG-627-trunk-2.patch
          13 kB
          Arup Malakar
        3. HCATALOG-627-trunk-1.patch
          13 kB
          Arup Malakar
        4. HCATALOG-627-trunk-0.patch
          13 kB
          Arup Malakar
        5. HCATALOG-627-branch-0.5-3.patch
          12 kB
          Arup Malakar
        6. HCATALOG-627-branch-0.5-2.patch
          21 kB
          Arup Malakar
        7. HCATALOG-627-branch-0.5-1.patch
          13 kB
          Arup Malakar
        8. HCATALOG-627-branch-0.5-0.patch
          13 kB
          Arup Malakar

          Activity

            People

            • Assignee:
              amalakar Arup Malakar
              Reporter:
              amalakar Arup Malakar
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: