[ https://issues.apache.org/jira/browse/FLINK-5669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15840741#comment-15840741 ]
ASF GitHub Bot commented on FLINK-5669: --------------------------------------- GitHub user rick-cox opened a pull request: https://github.com/apache/flink/pull/3223 [FLINK-5669] Change DataStreamUtils to use the loopback address (127.0.0.1) For local environments, using loopback rather than the "local address" allows tests to run in situations where the local machine's hostname may not be resolvable in DNS (because DNS is unreachable or the hostname is not found) or the hostname does resolve, but not to an IP address that is reachable. Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration. If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html). In addition to going through the list, please provide a meaningful description of your changes. - [x] General - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text") - The pull request addresses only one issue - Each commit in the PR has a meaningful commit message (including the JIRA id) - [x] Documentation - Documentation has been added for new functionality - Old documentation affected by the pull request has been updated - JavaDoc for public methods has been added - [x] Tests & Build - Functionality added by the pull request is covered by tests - `mvn clean verify` has been executed successfully locally or a Travis build has passed You can merge this pull request into a Git repository by running: $ git pull https://github.com/rick-cox/flink master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3223.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 #3223 ---- commit e12da9f1b2542fb1d5f862e1894c16ea834addcb Author: Rick Cox <rick...@amazon.com> Date: 2017-01-26T22:55:23Z [FLINK-5669] Change DataStreamUtils to use the loopback address (127.0.0.1) with local environments. Using loopback rather than the "local address" allows tests to run in situations where the local machine's hostname may not be resolvable in DNS (because DNS is unreacable or the hostname is not found) or the hostname does resolve, but not to an IP address that is reachable. ---- > flink-streaming-contrib DataStreamUtils.collect in local environment mode > fails when offline > -------------------------------------------------------------------------------------------- > > Key: FLINK-5669 > URL: https://issues.apache.org/jira/browse/FLINK-5669 > Project: Flink > Issue Type: Bug > Components: flink-contrib > Reporter: Rick Cox > Priority: Minor > > {{DataStreamUtils.collect()}} needs to obtain the local machine's IP so that > the job can send the results back. In the case of local > {{StreamEnvironments}}, it uses {{InetAddress.getLocalHost()}}, which > attempts to resolve the local hostname using DNS. > If DNS is not available (for example, when offline) or if DNS is available > but cannot resolve the hostname (for example, if the hostname is an intranet > name but the machine is not currently on that network), an > {{UnknownHostException}} will be thrown (and wrapped in an {{IOException}}). > If the resolved IP is not reachable for some reason, streaming results will > fail. > Since this case is for local execution only, it seems that using > {{InetAddress.getLoopbackAddress()}} would work just as well, and avoid the > assumptions made by {{getLocalHost()}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)