Github user nyaapa commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5424#discussion_r28024415
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -806,15 +808,20 @@ private[spark] object Utils extends Logging {
             // It's more proper to pick ip address following system output 
order.
             val activeNetworkIFs = NetworkInterface.getNetworkInterfaces.toList
             val reOrderedNetworkIFs = if (isWindows) activeNetworkIFs else 
activeNetworkIFs.reverse
    +
             for (ni <- reOrderedNetworkIFs) {
    -          for (addr <- ni.getInetAddresses if !addr.isLinkLocalAddress &&
    -               !addr.isLoopbackAddress && addr.isInstanceOf[Inet4Address]) 
{
    +          val addresses = ni.getInetAddresses.toList
    +            .filter { addr => !addr.isLinkLocalAddress && 
!addr.isLoopbackAddress }
    +          if ( !addresses.isEmpty ) {
    +            val addr = addresses.find( _.isInstanceOf[Inet4Address] 
).getOrElse(addresses.head)
    +            // because of Inet6Address.toHostName may add interface at the 
end if it knows about it
    +            val strippedAddress = InetAddress.getByAddress(addr.getAddress)
    --- End diff --
    
    It's all about finding our external IP address: old logic was to use 
external ipv4 || 127.0.0.1. 
    That transformes it to ipv4 || ipv6 || 127.0.0.1
    
    Whenewer we don't have any ipv4 it's better to use ipv6 than 127.0.0.1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to