keith-turner commented on code in PR #6049:
URL: https://github.com/apache/accumulo/pull/6049#discussion_r2873643109
##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1143,6 +1146,30 @@ private List<TabletMigration>
checkMigrationSanity(Set<TabletServerId> current,
}
+ /**
+ * This class tracks details about the haltRPCs used
+ */
+ private static class GracefulHaltTimer {
+
+ Duration maxHaltGraceDuration;
+ Timer timer;
+
+ public GracefulHaltTimer(AccumuloConfiguration config) {
+ timer = null;
+ maxHaltGraceDuration =
+
Duration.ofMillis(config.getTimeInMillis(Property.MANAGER_TSERVER_HALT_DURATION));
+ }
+
+ public void startTimer() {
+ timer = Timer.startNew();
+ }
+
+ public boolean shouldForceHalt() {
Review Comment:
This code is called in thread pool so over time different threads may call
startTimer() and shouldForceHalt(). The threads may not see previous threads
changes. If both methods are made synchronized then threads would always see
changes. Also defends against concurrent calls, but not sure that will happen
w/ the current code. Seeing changes made by other threads does seem to be an
issue though.
##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1143,6 +1146,30 @@ private List<TabletMigration>
checkMigrationSanity(Set<TabletServerId> current,
}
+ /**
+ * This class tracks details about the haltRPCs used
+ */
+ private static class GracefulHaltTimer {
+
+ Duration maxHaltGraceDuration;
+ Timer timer;
+
+ public GracefulHaltTimer(AccumuloConfiguration config) {
+ timer = null;
+ maxHaltGraceDuration =
+
Duration.ofMillis(config.getTimeInMillis(Property.MANAGER_TSERVER_HALT_DURATION));
+ }
+
+ public void startTimer() {
+ timer = Timer.startNew();
Review Comment:
Made a comment about this elsewhere, wondering if it should do the following.
```suggestion
if(timer == null){
timer = Timer.startNew();
}
```
--
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]