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


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -97,14 +98,31 @@
 
 class RaftServerImpl implements RaftServer.Division,
     RaftServerProtocol, RaftServerAsynchronousProtocol,
-    RaftClientProtocol, RaftClientAsynchronousProtocol{
+    RaftClientProtocol, RaftClientAsynchronousProtocol, ErrorRecorded {
   private static final String CLASS_NAME = 
JavaUtils.getClassSimpleName(RaftServerImpl.class);
   static final String REQUEST_VOTE = CLASS_NAME + ".requestVote";
   static final String APPEND_ENTRIES = CLASS_NAME + ".appendEntries";
   static final String INSTALL_SNAPSHOT = CLASS_NAME + ".installSnapshot";
   static final String LOG_SYNC = APPEND_ENTRIES + ".logComplete";
   static final String START_LEADER_ELECTION = CLASS_NAME + 
".startLeaderElection";
 
+  private Throwable throwable;
+
+  @Override
+  public void setError(Throwable t) {
+    throwable = t;
+    LOG.error("Server transitioning to EXCEPTION state due to", t);
+    // TODO(jiacheng): will the server keep serving or just die itself?

Review Comment:
   Sorry I'm new to Ratis code in general so not sure what's the recommended 
design. Will this be a good place for the server to exit, or it should check 
this state and exit somewhere else?



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