Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-6768

Fix a few unit tests that use hard-coded port numbers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.6.0
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      TestBlockRecovery uses hard-coded port numbers making it susceptible to 'port in use' errors as seen here

      Error Message
      
      Port in use: localhost:50070
      Stacktrace
      
      java.net.BindException: Port in use: localhost:50070
      	at sun.nio.ch.Net.bind(Native Method)
      	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:124)
      	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
      	at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
      	at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:853)
      	at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:794)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeHttpServer.start(NameNodeHttpServer.java:142)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.startHttpServer(NameNode.java:697)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:587)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:756)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:740)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1425)
      	at org.apache.hadoop.hdfs.MiniDFSCluster.createNameNode(MiniDFSCluster.java:1007)
      	at org.apache.hadoop.hdfs.MiniDFSCluster.createNameNodesAndSetConf(MiniDFSCluster.java:878)
      	at org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:707)
      	at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:378)
      	at org.apache.hadoop.hdfs.MiniDFSCluster$Builder.build(MiniDFSCluster.java:359)
      	at org.apache.hadoop.hdfs.server.datanode.TestBlockRecovery.testRaceBetweenReplicaRecoveryAndFinalizeBlock(TestBlockRecovery.java:592)
      

      TestRefreshCallQueue and TestGenericRefresh also use the same hard-coded port number (54222) which can result in 'port in use' errors with parallel-tests.

        Attachments

        1. HDFS-6768.01.patch
          8 kB
          Arpit Agarwal

          Issue Links

            Activity

              People

              • Assignee:
                arp Arpit Agarwal
                Reporter:
                arp Arpit Agarwal
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: