kevinrr888 commented on code in PR #5263:
URL: https://github.com/apache/accumulo/pull/5263#discussion_r1920552208


##########
core/src/main/java/org/apache/accumulo/core/fate/Fate.java:
##########
@@ -397,24 +443,27 @@ public Fate(T environment, FateStore<T> store, boolean 
runDeadResCleaner,
       Function<Repo<T>,String> toLogStrFunc, AccumuloConfiguration conf) {
     this.store = FateLogger.wrap(store, toLogStrFunc, false);
     this.environment = environment;
-    final ThreadPoolExecutor pool = 
ThreadPools.getServerThreadPools().createExecutorService(conf,
+    this.transactionExecutor = 
ThreadPools.getServerThreadPools().createExecutorService(conf,
         Property.MANAGER_FATE_THREADPOOL_SIZE, true);
     this.workQueue = new LinkedTransferQueue<>();
+    this.runningTxRunners = new ArrayList<>();
     this.fatePoolWatcher =
         
ThreadPools.getServerThreadPools().createGeneralScheduledExecutorService(conf);
     
ThreadPools.watchCriticalScheduledTask(fatePoolWatcher.scheduleWithFixedDelay(()
 -> {
       // resize the pool if the property changed
-      ThreadPools.resizePool(pool, conf, 
Property.MANAGER_FATE_THREADPOOL_SIZE);
-      // If the pool grew, then ensure that there is a TransactionRunner for 
each thread
+      ThreadPools.resizePool(transactionExecutor, conf, 
Property.MANAGER_FATE_THREADPOOL_SIZE);
       final int configured = 
conf.getCount(Property.MANAGER_FATE_THREADPOOL_SIZE);
-      final int needed = configured - pool.getActiveCount();
+      final int needed = configured - transactionExecutor.getActiveCount();

Review Comment:
   Right, I was misinterpreting the impact this change would have. This 
probably wouldn't be much refactoring. May be as simple as changing it to 
creating the cached pool instead of a fixed pool and deleting the 
`ThreadPools.resizePool(pool, conf, Property.MANAGER_FATE_THREADPOOL_SIZE);` 
call in the pool watcher task. In that case, it could be changed in this PR. I 
may be overlooking something though.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to