dlmarion commented on a change in pull request #2278:
URL: https://github.com/apache/accumulo/pull/2278#discussion_r713163570



##########
File path: 
server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
##########
@@ -323,16 +323,11 @@ public static ThreadPoolExecutor 
createSelfResizingThreadPool(final String serve
       // however, this isn't really an issue, since it adjusts periodically 
anyway
       if (pool.getCorePoolSize() <= pool.getActiveCount()) {
         int larger = pool.getCorePoolSize() + Math.min(pool.getQueue().size(), 
2);
-        log.info("Increasing server thread pool size on {} to {}", serverName, 
larger);
-        pool.setMaximumPoolSize(larger);
-        pool.setCorePoolSize(larger);
+        ThreadPools.resizePool(pool, () -> larger, serverName + "-ClientPool");
       } else {
         if (pool.getCorePoolSize() > pool.getActiveCount() + 3) {
           int smaller = Math.max(executorThreads, pool.getCorePoolSize() - 1);
-          if (smaller != pool.getCorePoolSize()) {
-            log.info("Decreasing server thread pool size on {} to {}", 
serverName, smaller);
-            pool.setCorePoolSize(smaller);
-          }
+          ThreadPools.resizePool(pool, () -> smaller, serverName + 
"-ClientPool");

Review comment:
       So, it would 
[appear](https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java#L1533)
 that raising the corePoolSize above the MaxPoolSize throws an error. Maybe 
this is what you were referring to?




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