Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-19050

DBNotificationListener does not catch exceptions in the cleaner thread

    XMLWordPrintableJSON

Details

    Description

      The DbNotificationListener class has a separate thread which cleans the old notifications from the database. Here is the snippet from the run method.

      public void run() {
            while (true) {
              rs.cleanNotificationEvents(ttl);
              LOG.debug("Cleaner thread done");
              try {
                Thread.sleep(sleepTime);
              } catch (InterruptedException e) {
                LOG.info("Cleaner thread sleep interrupted", e);
              }
            }
          }
      

      If rs.cleanNotificationEvents throws a RuntimeException which datanucleus can throw the exception remains uncaught and the thread will die. This can lead to older notifications never getting cleaned until we restart HMS. Given that many operations generate loads of events, the notification log table can quickly have thousands of rows which are never get cleaned up.

      Attachments

        1. HIVE-19050.01.patch
          6 kB
          Vihang Karajgaonkar

        Issue Links

          Activity

            People

              vihangk1 Vihang Karajgaonkar
              vihangk1 Vihang Karajgaonkar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: