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

    https://github.com/apache/storm/pull/1073#discussion_r51781615
  
    --- Diff: storm-core/src/jvm/org/apache/storm/utils/Utils.java ---
    @@ -1374,5 +1393,29 @@ public static RuntimeException 
wrapInRuntime(Exception e){
                 return new RuntimeException(e);
             }
         }
    +
    +    public static int getAvailablePort(Integer port) {
    +        Integer localPort = null;
    +        ServerSocket socket = null;
    +        try {
    +            socket = new ServerSocket(port);
    +            localPort = socket.getLocalPort();
    +        } catch (IOException exp) {
    +            getAvailablePort(0);
    --- End diff --
    
    also this should be done only if the input port is non-zero. similar to 
what is happening in clojure. since there is no control on recursion depth here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to