Vladsz83 commented on code in PR #11260:
URL: https://github.com/apache/ignite/pull/11260#discussion_r1522951414


##########
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java:
##########
@@ -9763,37 +9703,37 @@ public static Collection<InetSocketAddress> 
toSocketAddresses(ClusterNode node,
     }
 
     /**
-     * Returns tha list of resolved socket addresses. First addresses are 
resolved by host names,
-     * if this attempt fails then the addresses are resolved by ip addresses.
+     * Returns the list of resolved socket addresses.
      *
      * @param addrs Addresses.
      * @param hostNames Host names.
      * @param port Port.
      * @return Socket addresses for given addresses and host names.
      */
-    public static Collection<InetSocketAddress> 
toSocketAddresses(Collection<String> addrs,
-        Collection<String> hostNames, int port) {
+    public static Collection<InetSocketAddress> toSocketAddresses(
+        Collection<String> addrs,
+        Collection<String> hostNames, int port
+    ) {
         Set<InetSocketAddress> res = new HashSet<>(addrs.size());
 
-        Iterator<String> hostNamesIt = hostNames.iterator();
+        boolean hasAddr = false;
 
         for (String addr : addrs) {
-            String hostName = hostNamesIt.hasNext() ? hostNamesIt.next() : 
null;
+            InetSocketAddress inetSockAddr = createResolved(addr, port);
+            res.add(inetSockAddr);
 
-            if (!F.isEmpty(hostName)) {
-                InetSocketAddress inetSockAddr = createResolved(hostName, 
port);
+            if (!inetSockAddr.isUnresolved() && 
!inetSockAddr.getAddress().isLoopbackAddress())

Review Comment:
   Why we ignore loopbacks? Nodes can be launched on the same host. Do we need 
an external parameter here? To include or exclude loopback as a valid address? 
See `getEffectiveNodeAddresses(TcpDiscoveryNode node, boolean sameHost)`. It 
has similar parameter  `boolean sameHost`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to