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


##########
core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java:
##########
@@ -306,18 +306,19 @@ public void run() {
             }
           });
         } catch (Exception e) {
-          if (!fate.getKeepRunning().get() || isShutdown()) {
-            log.debug("Expected failure while attempting to find work for 
fate: either fate is "
-                + "being shutdown and therefore all fate threads are being 
shutdown or the "
-                + "fate threads assigned to work on {} were invalidated by 
config changes "
-                + "and are being shutdown", fateOps, e);
-          } else {
-            log.warn("Unexpected failure while attempting to find work for 
fate", e);
-          }
-
+          log.warn("Unexpected failure while attempting to find work for 
fate", e);
           workQueue.clear();
         }
       }
+
+      if (!fate.getKeepRunning().get() || isShutdown()) {

Review Comment:
   If an unexpected failure occurred (ie the catch Exception block), we could 
reach this code and this statement would not be true. Could add an else



##########
core/src/main/java/org/apache/accumulo/core/fate/FateExecutor.java:
##########
@@ -205,14 +205,14 @@ protected Set<Fate.FateOperation> getFateOps() {
    * Initiates the shutdown of this FateExecutor. This means the pool 
executing TransactionRunners
    * will no longer accept new TransactionRunners, the currently running 
TransactionRunners will
    * terminate after they are done with their current transaction, if 
applicable, and the work
-   * finder is interrupted. {@link #isShutdown()} returns true after this is 
called.
+   * finder is shutdown. {@link #isShutdown()} returns true after this is 
called.
    */
   protected void initiateShutdown() {
     transactionExecutor.shutdown();
     synchronized (runningTxRunners) {
       runningTxRunners.forEach(TransactionRunner::flagStop);
     }
-    workFinder.interrupt();

Review Comment:
   It seems cleaner to allow the work finder to gracefully stop via the check 
isShutdown() in the while loop. It also removes some error handling where we 
handle an error as expected, which isn't great and makes the logs confusing



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