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

haonan pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new 7acdb30ee9e chore!: Bind real config address for Thrift and Raft 
services (#16717) (#16730)
7acdb30ee9e is described below

commit 7acdb30ee9e4f84d3e7f3f8a53895bbf0cfec0ea
Author: CritasWang <[email protected]>
AuthorDate: Tue Nov 11 17:50:00 2025 +0800

    chore!: Bind real config address for Thrift and Raft services (#16717) 
(#16730)
---
 .../java/org/apache/iotdb/consensus/ratis/RatisConsensus.java     | 1 +
 .../apache/iotdb/commons/service/AbstractThriftServiceThread.java | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git 
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
 
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
index 384730a9742..20c30922432 100644
--- 
a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
+++ 
b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
@@ -156,6 +156,7 @@ class RatisConsensus implements IConsensus {
     this.storageDir = new File(config.getStorageDir());
 
     RaftServerConfigKeys.setStorageDir(properties, 
Collections.singletonList(storageDir));
+    GrpcConfigKeys.Server.setHost(properties, 
config.getThisNodeEndPoint().getIp());
     GrpcConfigKeys.Server.setPort(properties, 
config.getThisNodeEndPoint().getPort());
 
     Utils.initRatisConfig(properties, config.getRatisConfig());
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
index 171942d8610..0da0a92e379 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
@@ -283,11 +283,19 @@ public abstract class AbstractThriftServiceThread extends 
Thread {
 
   @SuppressWarnings("java:S2259")
   private TServerTransport openTransport(String bindAddress, int port) throws 
TTransportException {
+    if (bindAddress == null) {
+      // bind any address
+      return new TServerSocket(new InetSocketAddress(port));
+    }
     return new TServerSocket(new InetSocketAddress(bindAddress, port));
   }
 
   private TServerTransport openNonblockingTransport(
       String bindAddress, int port, int connectionTimeoutInMS) throws 
TTransportException {
+    if (bindAddress == null) {
+      // bind any address
+      return new TNonblockingServerSocket(new InetSocketAddress(port), 
connectionTimeoutInMS);
+    }
     return new TNonblockingServerSocket(
         new InetSocketAddress(bindAddress, port), connectionTimeoutInMS);
   }

Reply via email to