[
https://issues.apache.org/jira/browse/FLINK-3570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177811#comment-15177811
]
ASF GitHub Bot commented on FLINK-3570:
---------------------------------------
GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/1758
[FLINK-3570] [runtime] Use InetAddress.getLocalHost() as heuristic to find
local address
The ConnectionUtils.findAddressUsingStrategy method tries to find out the
local address which is
accessible by other machines of the cluster. It tries to connect to a
specified address to do so.
In case that the no connection could be established, it uses an heuristic.
Before it randomly
picked a NetworkInterface which is bound to an Inet4Address, not a loop
back address and not a
link local address. In most cases it makes more sense to default to the
InetAddress.getLocalHost() address instead. This PR replaces the old
heuristic with simply
returning the InetAddress.getLocalHost(). This of course requires that the
system on which Flink
is running, is properly configured.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tillrohrmann/flink fixNICHeuristic
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1758.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1758
----
commit 121fe848d2ef55af36445dae7e8b0a9ffb468daf
Author: Till Rohrmann <[email protected]>
Date: 2016-03-03T13:24:42Z
[FLINK-3570] [runtime] Use InetAddress.getLocalHost() as heuristic to find
local address
The ConnectionUtils.findAddressUsingStrategy method tries to find out the
local address which is
accessible by other machines of the cluster. It tries to connect to a
specified address to do so.
In case that the no connection could be established, it uses an heuristic.
Before it randomly
picked a NetworkInterface which is bound to an Inet4Address, not a loop
back address and not a
link local address. In most cases it makes more sense to default to the
InetAddress.getLocalHost() address instead. This PR replaces the old
heuristic with simply
returning the InetAddress.getLocalHost(). This of course requires that the
system on which Flink
is running, is properly configured.
----
> Replace random NIC selection heuristic by InetAddress.getLocalHost
> ------------------------------------------------------------------
>
> Key: FLINK-3570
> URL: https://issues.apache.org/jira/browse/FLINK-3570
> Project: Flink
> Issue Type: Improvement
> Components: Distributed Runtime
> Affects Versions: 1.0.0, 1.1.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
> Priority: Minor
>
> Currently, the {{ConnectionUtils.findAddressUsingStrategy}} method returns
> the first {{NetworkInterface}} whose address is not a loop back address, not
> a link local address and an {{Inet4Address}}. Before returning this address,
> it is retried to connect to the {{JobManager}} using the
> {{InetAddress.getLocalHost}} address a last time.
> The heuristic, if not choosing the {{InetAddress.getLocalHost}}, often makes
> no sense because it returns a random {{NetworkInterface}} address. It would
> be better to simply return the {{InetAddress.getLocalHost()}} instead.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)