Apache9 commented on a change in pull request #513: HBASE-22867 The 
ForkJoinPool in CleanerChore will spawn thousands of threads in our cluster 
with thousands table
URL: https://github.com/apache/hbase/pull/513#discussion_r316484522
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/DirScanPool.java
 ##########
 @@ -42,11 +45,16 @@ public DirScanPool(Configuration conf) {
     // poolSize may be 0 or 0.0 from a careless configuration,
     // double check to make sure.
     size = size == 0 ? 
CleanerChore.calculatePoolSize(CleanerChore.DEFAULT_CHORE_POOL_SIZE) : size;
-    pool = new ForkJoinPool(size);
+    pool = initializePool(size);
     LOG.info("Cleaner pool size is {}", size);
     cleanerLatch = 0;
   }
 
+  private static ThreadPoolExecutor initializePool(int size) {
+    return new ThreadPoolExecutor(size, size, 500, TimeUnit.SECONDS, new 
LinkedBlockingQueue<>(),
 
 Review comment:
   Usually it will be 1 minute? Why 500 seconds? And I think we can call 
allowCoreThreadTimeOut(true) here to release the threads if not needed?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to