You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/03/26 14:44:22 UTC

[iotdb] branch rel/1.1 updated: [To rel/1.1][IOTDB-5729] Fix RatisConsensus ResponseMessage conversion error (#9455)

This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch rel/1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.1 by this push:
     new 5037e12f67 [To rel/1.1][IOTDB-5729] Fix RatisConsensus ResponseMessage conversion error (#9455)
5037e12f67 is described below

commit 5037e12f671eb98f908c9fbe5170954d802c5c48
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Sun Mar 26 22:44:17 2023 +0800

    [To rel/1.1][IOTDB-5729] Fix RatisConsensus ResponseMessage conversion error (#9455)
---
 .../apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
index 80f11ac05e..44516072c2 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.request.ByteBufferConsensusRequest;
 import org.apache.iotdb.consensus.common.request.IConsensusRequest;
 import org.apache.iotdb.consensus.ratis.metrics.RatisMetricsManager;
+import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.ratis.proto.RaftProtos;
 import org.apache.ratis.proto.RaftProtos.RaftConfigurationProto;
@@ -163,7 +164,10 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
         Thread.currentThread().interrupt();
       } catch (Throwable rte) {
         logger.error("application statemachine throws a runtime exception: ", rte);
-        ret = Message.valueOf("internal error. statemachine throws a runtime exception: " + rte);
+        ret =
+            new ResponseMessage(
+                new TSStatus(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode())
+                    .setMessage("internal error. statemachine throws a runtime exception: " + rte));
         if (applicationStateMachine.isReadOnly()) {
           waitUntilSystemNotReadOnly();
           shouldRetry = true;