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

Guard against a ThreadPool size of 0 in CleanerChore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.0.0-beta-1, 2.0.0
    • None
    • None
    • Reviewed

    Description

      Post HBASE-18309, we choose the number of threads by the following logic:

      +  /**
      +   * If it is an integer and >= 1, it would be the size;
      +   * if 0.0 < size <= 1.0, size would be available processors * size.
      +   * Pay attention that 1.0 is different from 1, former indicates it will use 100% of cores,
      +   * while latter will use only 1 thread for chore to scan dir.
      +   */
      

      swagle has found on his VM that despite having two virtual processors, Runtime.getRuntime().availableProcessors() returns 0, which results in 0 threads for the pool which throws an exception.

      java.lang.IllegalArgumentException
              at java.util.concurrent.ForkJoinPool.checkParallelism(ForkJoinPool.java:2546)
              at java.util.concurrent.ForkJoinPool.<init>(ForkJoinPool.java:2536)
              at java.util.concurrent.ForkJoinPool.<init>(ForkJoinPool.java:2505)
              at org.apache.hadoop.hbase.master.cleaner.CleanerChore.<init>(CleanerChore.java:112)
              at org.apache.hadoop.hbase.master.cleaner.CleanerChore.<init>(CleanerChore.java:83)
              at org.apache.hadoop.hbase.master.cleaner.LogCleaner.<init>(LogCleaner.java:65)
              at org.apache.hadoop.hbase.master.HMaster.startServiceThreads(HMaster.java:1130)
              at org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:813)
              at org.apache.hadoop.hbase.master.HMaster.access$500(HMaster.java:223)
              at org.apache.hadoop.hbase.master.HMaster$4.run(HMaster.java:2016)
              at java.lang.Thread.run(Thread.java:745)
      

      We should make sure that we take the max of 1 and the computed number of threads.

      Attachments

        1. HBASE-19709.002.branch-2.patch
          4 kB
          Josh Elser
        2. HBASE-19709.001.branch-2.patch
          4 kB
          Josh Elser

        Issue Links

          Activity

            People

              elserj Josh Elser
              swagle Siddharth Wagle
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: