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 2021/09/02 06:48:12 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #3797: [IOTDB-1564] Make hearbeat and election timeout parameters be configurable

jixuan1989 commented on a change in pull request #3797:
URL: https://github.com/apache/iotdb/pull/3797#discussion_r700794103



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataHeartbeatClient.java
##########
@@ -38,14 +38,19 @@
   private SyncDataHeartbeatClient(TProtocolFactory protocolFactory, Node node, SyncClientPool pool)
       throws TTransportException {
     // the difference of the two clients lies in the port
+    // Heartbeat client connection timeout should not be larger than heartbeat interval, otherwise
+    // the thread pool of sending heartbeats or requesting votes may be used up by waiting for
+    // establishing connection with some slow or dead nodes.
     super(
         protocolFactory.getProtocol(
             RpcTransportFactory.INSTANCE.getTransport(
                 new TSocket(
                     TConfigurationConst.defaultTConfiguration,
                     node.getInternalIp(),
                     node.getDataPort() + ClusterUtils.DATA_HEARTBEAT_PORT_OFFSET,
-                    RaftServer.getConnectionTimeoutInMS()))));
+                    Math.min(

Review comment:
       ```Math.min(
                           (int) RaftServer.getHeartbeatIntervalMs(),
                           RaftServer.getConnectionTimeoutInMS()))))```
   can be saved in `RaftServer` as a new field.




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