[ 
https://issues.apache.org/jira/browse/HBASE-19709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16312288#comment-16312288
 ] 

Reid Chan commented on HBASE-19709:
-----------------------------------

Looks like {{private static final int AVAIL_PROCESSORS = 
Runtime.getRuntime().availableProcessors();}} somehow gets a zero.
And thank you for the UT, it is good.

> Guard against a ThreadPool size of 0 in CleanerChore
> ----------------------------------------------------
>
>                 Key: HBASE-19709
>                 URL: https://issues.apache.org/jira/browse/HBASE-19709
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Siddharth Wagle
>            Assignee: Josh Elser
>            Priority: Critical
>             Fix For: 3.0.0, 2.0.0-beta-2
>
>         Attachments: HBASE-19709.001.branch-2.patch
>
>
> Post HBASE-18309, we choose the number of threads by the following logic:
> {code}
> +  /**
> +   * 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.
> +   */
> {code}
> [~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.
> {noformat}
> 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)
> {noformat}
> We should make sure that we take the max of {{1}} and the computed number of 
> threads.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to