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

Brahma Reddy Battula commented on HADOOP-13234:
-----------------------------------------------

Ok..Only difference might {{ServerSocket(0).getLocalPort()}} will give free 
port (32768-61000 on Linux and 49152-65535 on Windows) and {{getPort{p, 
retries)}} will retries the range between p and 65535( diff might be retry).

So we can close this issue..? and to adress the following which is mentioned by 
[~xyao], need to increase the retry..?
{noformat}
java.io.IOException: Port is already in use; giving up after 10 times.
        at 
org.apache.hadoop.net.ServerSocketUtil.waitForPort(ServerSocketUtil.java:98)
        at 
org.apache.hadoop.hdfs.TestDFSShell.testMoveWithTargetPortEmpty(TestDFSShell.java:809)
{noformat}

> Get random port by new ServerSocket(0).getLocalPort() in 
> ServerSocketUtil#getPort
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-13234
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13234
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Brahma Reddy Battula
>            Assignee: Brahma Reddy Battula
>         Attachments: HADOOP-13234-002.patch, HADOOP-13234.patch
>
>
> As per [~iwasakims] comment from 
> [here|https://issues.apache.org/jira/browse/HDFS-10367?focusedCommentId=15275604&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15275604]
> we can get available random port by {{new ServerSocket(0).getLocalPort()}} 
> and it's more portable. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to