ctubbsii commented on code in PR #2990:
URL: https://github.com/apache/accumulo/pull/2990#discussion_r985169200


##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -225,6 +226,35 @@ public boolean stillManager() {
     return getManagerState() != ManagerState.STOP;
   }
 
+  Fate<Manager> fate() {
+    Fate<Manager> fate = fateReady.get();
+    if (fate != null) {
+      // it's ready, just return it
+      return fate;
+    }
+
+    // it's not ready yet
+    long retryTime = 500; // millis
+
+    // create informative warning
+    String msgPrefix = "Unexpected use of fate in thread " + 
Thread.currentThread().getName()
+        + " at time " + System.currentTimeMillis();
+    log.warn("{} blocked until fate starts", msgPrefix,
+        new IllegalStateException("Attempted fate action before fate was 
started; "
+            + "if this doesn't make progress, please report it as a bug to the 
developers"));

Review Comment:
   I'm not sure about shutting down the manager. The manager might not be able 
to help that a tserver or client is asking it to do something when it's not 
ready. But, I do like the idea of logging periodically if it isn't making 
progress. I'd rather put it into a loop for that. I could make it 5 minutes and 
log a warning. I used trace before when I was looping 250ms, but warning I 
think is most appropriate if it's stuck for 5 minutes.



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