szetszwo commented on code in PR #733:
URL: https://github.com/apache/ratis/pull/733#discussion_r976024124


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java:
##########
@@ -221,6 +222,7 @@ String toString(RaftGroupId groupId, 
CompletableFuture<RaftServerImpl> f) {
     final TimeDuration leaderStepDownWaitTime = 
RaftServerConfigKeys.LeaderElection.leaderStepDownWaitTime(properties);
     this.pauseMonitor = new JvmPauseMonitor(id,
         extraSleep -> handleJvmPause(extraSleep, rpcSlownessTimeout, 
leaderStepDownWaitTime));
+    this.threadGroup = threadGroup == null ? new 
ThreadGroup("raft-server-proxy") : threadGroup;

Review Comment:
   No default `uncaughtException(..)` probably is okay since it will use the 
system default.



##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java:
##########
@@ -221,6 +222,7 @@ String toString(RaftGroupId groupId, 
CompletableFuture<RaftServerImpl> f) {
     final TimeDuration leaderStepDownWaitTime = 
RaftServerConfigKeys.LeaderElection.leaderStepDownWaitTime(properties);
     this.pauseMonitor = new JvmPauseMonitor(id,
         extraSleep -> handleJvmPause(extraSleep, rpcSlownessTimeout, 
leaderStepDownWaitTime));
+    this.threadGroup = threadGroup == null ? new 
ThreadGroup("raft-server-proxy") : threadGroup;

Review Comment:
   Please use `id` for the name.



##########
ratis-server/src/test/java/org/apache/ratis/server/impl/MiniRaftCluster.java:
##########
@@ -390,7 +390,8 @@ private RaftServerProxy newRaftServer(RaftPeerId id, 
RaftGroup group, boolean fo
       RaftServerConfigKeys.setStorageDir(prop, Collections.singletonList(dir));
       return ServerImplUtils.newRaftServer(id, group,
           format? RaftStorage.StartupOption.FORMAT: 
RaftStorage.StartupOption.RECOVER,
-          getStateMachineRegistry(prop), prop, 
setPropertiesAndInitParameters(id, group, prop));
+          getStateMachineRegistry(prop),
+              new ThreadGroup("test-raft-server"), prop, 
setPropertiesAndInitParameters(id, group, prop));

Review Comment:
   Pass `null` so that it will use the default `ThreadGroup`.



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