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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 88185e89db7 [improvement](nereids) improve show frontends so slow 
issue when we don't enable fqdn mode in fe.conf because of using dns resolve 
firstly but not ip directly (#62139)
88185e89db7 is described below

commit 88185e89db727d47c001a38ec2f61571591d4e78
Author: heguanhui <[email protected]>
AuthorDate: Wed Jun 3 17:03:31 2026 +0800

    [improvement](nereids) improve show frontends so slow issue when we don't 
enable fqdn mode in fe.conf because of using dns resolve firstly but not ip 
directly (#62139)
    
    ### What problem does this PR solve?
    
    improve show frontends so slow issue when we don't enable fqdn mode in
    fe.conf because of using dns resolve firstly but not ip directly
---
 .../doris/common/proc/FrontendsProcNode.java       | 50 +++++++++++-----------
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/FrontendsProcNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/FrontendsProcNode.java
index f83a49bf8bf..306a819236f 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/FrontendsProcNode.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/FrontendsProcNode.java
@@ -204,35 +204,37 @@ public class FrontendsProcNode implements 
ProcNodeInterface {
     }
 
     private static boolean isJoin(List<InetSocketAddress> allFeHosts, Frontend 
fe) {
+        String feHost = fe.getHost();
+        int fePort = fe.getEditLogPort();
         for (InetSocketAddress addr : allFeHosts) {
-            if (fe.getEditLogPort() != addr.getPort()) {
+            if (fePort != addr.getPort()) {
                 continue;
             }
-            // if hostname of InetSocketAddress is ip, addr.getHostName() may 
be not equal to fe.getIp()
-            // so we need to compare fe.getIp() with address.getHostAddress()
-            InetAddress address = addr.getAddress();
-            if (null == address) {
-                LOG.warn("Failed to get InetAddress {}", addr);
-                continue;
-            }
-            if (fe.getHost().equals(address.getHostAddress())) {
-                return true;
-            }
-        }
-
-        // Avoid calling getHostName multiple times, don't remove it
-        for (InetSocketAddress addr : allFeHosts) {
-            // Avoid calling getHostName multiple times, don't remove it
-            if (fe.getEditLogPort() != addr.getPort()) {
-                continue;
-            }
-            // 
https://bugs.openjdk.org/browse/JDK-8143378#:~:text=getHostName()%3B%20takes%20about%205,millisecond%20on%20JDK%20update%2051
-            // getHostName sometime has bug, take 5s
-            String host = addr.getHostName();
-            if (!Strings.isNullOrEmpty(host)) {
-                if (host.equals(fe.getHost())) {
+            if (Config.enable_fqdn_mode) {
+                String hostName = addr.getHostName();
+                if (!Strings.isNullOrEmpty(hostName) && 
hostName.equals(feHost)) {
+                    return true;
+                }
+                InetAddress address = addr.getAddress();
+                if (address != null && 
feHost.equals(address.getHostAddress())) {
                     return true;
                 }
+                if (address == null && !Strings.isNullOrEmpty(hostName) && 
hostName.equals(feHost)) {
+                    return true;
+                }
+            } else {
+                InetAddress address = addr.getAddress();
+                if (address != null) {
+                    String addrIp = address.getHostAddress();
+                    if (feHost.equals(addrIp)) {
+                        return true;
+                    }
+                } else {
+                    String hostName = addr.getHostName();
+                    if (!Strings.isNullOrEmpty(hostName) && 
hostName.equals(feHost)) {
+                        return true;
+                    }
+                }
             }
         }
         return false;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to