Copilot commented on code in PR #8904:
URL: https://github.com/apache/hbase/pull/8904#discussion_r4612551042


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -335,12 +346,18 @@ public BucketCache(String ioEngineName, long capacity, 
int blockSize, int[] buck
     Configuration conf, Map<String, HRegion> onlineRegions) throws IOException 
{
     Preconditions.checkArgument(blockSize > 0,
       "BucketCache capacity is set to " + blockSize + ", can not be less than 
0");
+
+    // Initialize the lock pool
     boolean useStrongRef = conf.getBoolean(STRONG_REF_KEY, STRONG_REF_DEFAULT);
+    int lockJanitorPeriod =
+      conf.getInt(LOCK_JANITOR_PERIOD_CONFIG_NAME, 
DEFAULT_LOCK_JANITOR_PERIOD);

Review Comment:
   Please validate that the janitor period is positive here, before allocating 
the IO engine or starting background threads. With the default soft-reference 
mode, setting this new property to 0 or a negative value makes 
scheduleAtFixedRate throw IllegalArgumentException near the end of the 
constructor. By then the writer threads and statistics executor have already 
started, but construction fails without returning a cache that the caller can 
shut down, leaking those threads and their cache resources.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to