[ 
https://issues.apache.org/jira/browse/FLINK-5669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15842963#comment-15842963
 ] 

ASF GitHub Bot commented on FLINK-5669:
---------------------------------------

Github user rick-cox commented on the issue:

    https://github.com/apache/flink/pull/3223
  
    Thanks for taking a look. Could you explain more? The modified code is in 
the else branch of ```if (env instanceof RemoteStreamEnvironment)```, so my 
assumption was that it only needed to work for local execution. (And that it 
wouldn't have worked if used with remote execution before, because it just 
selects the IP returned by DNS, which is often not the IP that a remote 
taskmanager would need to use to reach the client --- hence the use of 
```ConnectionUtils.findConnectingAddress``` in the remote case.)


> 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)

Reply via email to