Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-14891

Add log for uncaught exception in RegionServerMetricsWrapperRunnable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.0, 1.3.0, 2.0.0
    • metrics
    • None

    Description

      We are using ScheduledExecutorService#scheduleWithFixedDelay to periodically reporting metrics. From javadoc of this method

      If any execution of the task encounters an exception, subsequent executions are suppressed.

      We could see if any uncaught exception like NPE thrown in the task thread, there won't be any error thrown but the task would be silently terminated.

      In our real case we were making some modification to the metrics and causing NPE carelessly, then we found metrics disappeared but cannot get a clue from RS log.

      Suggest to catch Throwable in MetricsRegionServerWrapperImpl$RegionServerMetricsWrapperRunnable, add some log there and suppress the exception to give it another try at next scheduled run.

      Attachments

        1. HBASE-14891.patch
          1 kB
          Yu Li
        2. HBASE-14891.v2.patch
          17 kB
          Yu Li
        3. HBASE-14891.v2.patch
          17 kB
          Heng Chen
        4. HBASE-14891.branch-1.patch
          13 kB
          Yu Li
        5. HBASE-14891.branch-1.2.patch
          12 kB
          Yu Li

        Activity

          People

            liyu Yu Li
            liyu Yu Li
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: