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

Chris Nauroth commented on HDFS-7553:
-------------------------------------

I think patch v03 is the right idea.  Here are a few comments.
# I'd like to make one more change in {{MiniDFSCluster}}.  In the {{shutdown}} 
method, there is another spot that duplicates the calls to {{NameNode#stop}} 
and {{NameNode#join}}.  I'd like to add the call to {{NameNodeHttpServer#join}} 
there too.  This isn't directly related to the test failure that was reported 
originally, but it can help protect us from other similar problems in the 
future.  Possibly consider a helper method to refactor some of the duplication.
# We should not swallow {{InterruptedException}}.  The Hadoop code has a bad 
habit of doing this, but it's a bad practice, because it can cause harm to 
other parts of the code that expect to have visbility of the thread's 
interrupted status.  In the {{catch (InterruptedException e)}} block, add a 
call to {{Thread.currentThread().interrupt()}} to restore the interrupted 
status.

Thank you!

> fix the TestDFSUpgradeWithHA due to BindException
> -------------------------------------------------
>
>                 Key: HDFS-7553
>                 URL: https://issues.apache.org/jira/browse/HDFS-7553
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 2.7.0
>            Reporter: Liang Xie
>            Assignee: Liang Xie
>              Labels: BB2015-05-TBR
>         Attachments: HDFS-7553-001.txt, HDFS-7553.002.patch, 
> HDFS-7553.03.patch, HDFS-7553.repro.patch
>
>
> see 
> https://builds.apache.org/job/PreCommit-HDFS-Build/9092//testReport/org.apache.hadoop.hdfs.server.namenode.ha/TestDFSUpgradeWithHA/testNfsUpgrade/
>  :
> Error Message
> Port in use: localhost:57896
> Stacktrace
> java.net.BindException: Port in use: localhost:57896
>       at sun.nio.ch.Net.bind0(Native Method)
>       at sun.nio.ch.Net.bind(Net.java:444)
>       at sun.nio.ch.Net.bind(Net.java:436)
>       at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
>       at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
>       at 
> org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
>       at 
> org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:868)
>       at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:809)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNodeHttpServer.start(NameNodeHttpServer.java:142)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.startHttpServer(NameNode.java:704)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:591)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:763)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:747)
>       at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1443)
>       at 
> org.apache.hadoop.hdfs.MiniDFSCluster.restartNameNode(MiniDFSCluster.java:1815)
>       at 
> org.apache.hadoop.hdfs.MiniDFSCluster.restartNameNode(MiniDFSCluster.java:1796)
>       at 
> org.apache.hadoop.hdfs.server.namenode.ha.TestDFSUpgradeWithHA.testNfsUpgrade(TestDFSUpgradeWithHA.java:285)



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

Reply via email to