keith-turner commented on code in PR #5263:
URL: https://github.com/apache/accumulo/pull/5263#discussion_r1920505015


##########
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:
   Definitely want to keep this PR, using a cached thread pool would not solve 
the problems this PR is solving.  Using the cached thread pool would be 
complimentary to theses changes and may make the overall code simpler, but not 
sure.  Was thinking we could only rely on the new ` runningTxRunners` list 
added in this PR and not have to worry about resizing the thread pool if using 
a cached thread pool.  Don't worry about using it in this PR.
   
   The cached thread pool could  simplify #5130 also as you mentioned.  I think 
the changes in the PR would still be built on 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: [email protected]

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

Reply via email to