This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch HighAvailability in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 2d034d42b8d5b4ca661599dfe679feefdc4b6d71 Author: JackieTien97 <[email protected]> AuthorDate: Mon Oct 23 21:27:42 2023 +0800 add other exceptions --- .../src/main/java/org/apache/iotdb/SessionExample.java | 12 ++++++------ .../consensus/iot/client/AsyncIoTConsensusServiceClient.java | 6 +++++- .../queryengine/plan/scheduler/AsyncSendPlanNodeHandler.java | 2 +- .../java/org/apache/iotdb/commons/client/ThriftClient.java | 7 ++++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java b/example/session/src/main/java/org/apache/iotdb/SessionExample.java index cc040fb93ea..0f7129c7a85 100644 --- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java +++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java @@ -348,9 +348,9 @@ public class SessionExample { types.add(TSDataType.FLOAT); types.add(TSDataType.FLOAT); List<Object> values = new ArrayList<>(); - values.add(2.0f); - values.add(2.0f); - values.add(2.0f); + values.add(4.0f); + values.add(4.0f); + values.add(4.0f); List<List<String>> measurementsList = new ArrayList<>(); measurementsList.add(measurements); @@ -363,9 +363,9 @@ public class SessionExample { valuesList.add(values); List<Long> timestamps = new ArrayList<>(); - timestamps.add(2L); - timestamps.add(2L); - timestamps.add(2L); + timestamps.add(4L); + timestamps.add(4L); + timestamps.add(4L); List<List<TSDataType>> typesList = new ArrayList<>(); typesList.add(types); diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java index ed32300dd58..f2b77a499ec 100644 --- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java +++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java @@ -27,6 +27,7 @@ import org.apache.iotdb.commons.client.property.ThriftClientProperty; import org.apache.iotdb.consensus.iot.thrift.IoTConsensusIService; import org.apache.iotdb.rpc.TNonblockingSocketWrapper; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.pool2.PooledObject; import org.apache.commons.pool2.impl.DefaultPooledObject; import org.apache.thrift.async.TAsyncClientManager; @@ -110,7 +111,10 @@ public class AsyncIoTConsensusServiceClient extends IoTConsensusIService.AsyncCl checkReady(); return true; } catch (Exception e) { - logger.info("Unexpected exception occurs in {} :", this, e); + logger.info( + "Unexpected exception occurs in {}, error msg is {}", + this, + ExceptionUtils.getRootCause(e).toString()); return false; } } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/AsyncSendPlanNodeHandler.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/AsyncSendPlanNodeHandler.java index dea6a162655..ed7601b0b3b 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/AsyncSendPlanNodeHandler.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/AsyncSendPlanNodeHandler.java @@ -103,6 +103,6 @@ public class AsyncSendPlanNodeHandler implements AsyncMethodCallback<TSendBatchP } private boolean needRetry(TSendSinglePlanNodeResp resp) { - return DispatchLogHandler.needRetry(resp.status.code); + return !resp.accepted && DispatchLogHandler.needRetry(resp.status.code); } } diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java index a93fe75f2b9..7b3924a90d3 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java @@ -89,8 +89,8 @@ public interface ThriftClient { if (o.printLogWhenEncounterException()) { logger.info( "Broken pipe error happened in sending RPC," - + " we need to clear all previous cached connection", - t); + + " we need to clear all previous cached connection, error msg is {}", + rootCause.toString()); } o.invalidateAll(); } @@ -106,7 +106,8 @@ public interface ThriftClient { static boolean isConnectionBroken(Throwable cause) { return (cause instanceof SocketException && cause.getMessage().contains("Broken pipe")) || (cause instanceof TTransportException - && cause.getMessage().contains("Socket is closed by peer")) + && (cause.getMessage().contains("Socket is closed by peer") + || cause.getMessage().contains("Read call frame size failed"))) || (cause instanceof IOException && cause.getMessage().contains("Connection reset by peer")); }
