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

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

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

    https://github.com/apache/flink/pull/3391#discussion_r103203962
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java
 ---
    @@ -80,44 +79,23 @@ public static ActorSystem startActorSystem(
                        throw new IllegalArgumentException("Invalid port range 
definition: " + portRangeDefinition);
                }
     
    -           while (portsIterator.hasNext()) {
    -                   // first, we check if the port is available by opening 
a socket
    -                   // if the actor system fails to start on the port, we 
try further
    -                   ServerSocket availableSocket = 
NetUtils.createSocketFromPorts(
    -                           portsIterator,
    -                           new NetUtils.SocketFactory() {
    -                                   @Override
    -                                   public ServerSocket createSocket(int 
port) throws IOException {
    -                                           return new ServerSocket(port);
    -                                   }
    -                           });
    -
    -                   int port;
    -                   if (availableSocket == null) {
    -                           throw new BindException("Unable to allocate 
further port in port range: " + portRangeDefinition);
    -                   } else {
    -                           port = availableSocket.getLocalPort();
    +           return NetUtils.createServerFromPorts(listeningAddress, 
portsIterator, new NetUtils.ServerFactory<ActorSystem>() {
    +                   @Override
    +                   public ActorSystem create(String address, int port) 
throws Exception {
                                try {
    -                                   availableSocket.close();
    -                           } catch (IOException ignored) {}
    -                   }
    -
    -                   try {
    -                           return startActorSystem(configuration, 
listeningAddress, port, logger);
    -                   }
    -                   catch (Exception e) {
    -                           // we can continue to try if this contains a 
netty channel exception
    -                           Throwable cause = e.getCause();
    -                           if (!(cause instanceof 
org.jboss.netty.channel.ChannelException ||
    -                                           cause instanceof 
java.net.BindException)) {
    -                                   throw e;
    -                           } // else fall through the loop and try the 
next port
    +                                   return startActorSystem(configuration, 
address, port, logger);
    +                           }
    +                           catch (Exception e) {
    +                                   Throwable cause = e.getCause();
    +                                   if (cause instanceof 
org.jboss.netty.channel.ChannelException ||
    +                                           cause instanceof 
java.net.BindException) {
    +                                           throw new 
BindException(e.getMessage());
    --- End diff --
    
    not good to throw away the stack trace of the cause.


> Port-range for the web interface via YARN
> -----------------------------------------
>
>                 Key: FLINK-5758
>                 URL: https://issues.apache.org/jira/browse/FLINK-5758
>             Project: Flink
>          Issue Type: Sub-task
>          Components: YARN
>    Affects Versions: 1.2.0, 1.1.4, 1.3.0
>            Reporter: Kanstantsin Kamkou
>            Assignee: Yelei Feng
>              Labels: network
>
> In case of YARN, the {{ConfigConstants.JOB_MANAGER_WEB_PORT_KEY}}   [is 
> changed to 
> 0|https://github.com/apache/flink/blob/release-1.2.0/flink-yarn/src/main/java/org/apache/flink/yarn/YarnApplicationMasterRunner.java#L526].
>  Please allow port ranges in this case. DevOps need that.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to