You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/31 14:54:45 UTC

[GitHub] [iotdb] OneSizeFitsQuorum commented on a diff in pull request #6101: [IOTDB-3317] RatisConsensus fallback for StateMachine RuntimeException

OneSizeFitsQuorum commented on code in PR #6101:
URL: https://github.com/apache/iotdb/pull/6101#discussion_r885741955


##########
consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java:
##########
@@ -116,8 +116,14 @@ public CompletableFuture<Message> applyTransaction(TransactionContext trx) {
               log.getStateMachineLogEntry().getLogData().asReadOnlyByteBuffer());
     }
 
-    TSStatus result = applicationStateMachine.write(applicationRequest);
-    Message ret = new ResponseMessage(result);
+    Message ret;
+    try {
+      TSStatus result = applicationStateMachine.write(applicationRequest);
+      ret = new ResponseMessage(result);
+    } catch (Exception rte) {
+      logger.error("application statemachine throws a runtime exception: ", rte);
+      ret = Message.valueOf("internal error. statemachine throws a runtime exception");

Review Comment:
   include the exception message



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org