You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Patrick Wendell (JIRA)" <ji...@apache.org> on 2014/09/16 06:54:35 UTC

[jira] [Resolved] (SPARK-3040) Reverse order of Utils.findLocalIpAddress on UNIX

     [ https://issues.apache.org/jira/browse/SPARK-3040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Wendell resolved SPARK-3040.
------------------------------------
          Resolution: Fixed
       Fix Version/s: 1.2.0
    Target Version/s:   (was: 1.1.0)

https://issues.apache.org/jira/browse/SPARK-3543

> Reverse order of Utils.findLocalIpAddress on UNIX
> -------------------------------------------------
>
>                 Key: SPARK-3040
>                 URL: https://issues.apache.org/jira/browse/SPARK-3040
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 1.0.2
>         Environment: Mac os x, a bunch of network interfaces: eth0, wlan0, vnic0, vnic1, tun0, lo
>            Reporter: Ye Xianjin
>            Priority: Trivial
>             Fix For: 1.2.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I noticed this inconvenience when I ran spark-shell with my virtual machines on and VPN service running.
> There are a lot of network interfaces on my laptop(inactive devices omitted):
> {quote}
> lo0: inet 127.0.0.1
> en1: inet 192.168.0.102
> vnic0: inet 10.211.55.2 (virtual if for vm1)
> vnic1: inet 10.37.129.3 (virtual if for vm2)
> tun0: inet 172.16.100.191 --> 172.16.100.191 (tun device for VPN)
> {quote}
> In spark core, Utils.findLocalIpAddress() uses NetworkInterface.getNetworkInterfaces to get all active network interfaces, but unfortunately, this method returns network interfaces in reverse order compared to the ifconfig output (both use ioctl sys call). I dug into the openJDK 6 and 7 source code and confirms this behavior(It just happens on unix-like system, windows deals with it and returns in index order). So, the findLocalIpAddress method will pick the ip address associated with tun0 rather than en1



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org