Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-3320

NPE in NetworkTopology.getDistance()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.14.0
    • 0.18.0
    • None
    • None
    • Reviewed

    Description

      I am seeing the following exception:

      08/04/28 20:15:09 ERROR dfs.NNThroughputBenchmark: java.lang.NullPointerException
      	at org.apache.hadoop.net.NetworkTopology.getDistance(NetworkTopology.java:443)
      	at org.apache.hadoop.dfs.ReplicationTargetChooser.getPipeline(ReplicationTargetChooser.java:457)
      	at org.apache.hadoop.dfs.ReplicationTargetChooser.chooseTarget(ReplicationTargetChooser.java:126)
      	at org.apache.hadoop.dfs.ReplicationTargetChooser.chooseTarget(ReplicationTargetChooser.java:72)
      	at org.apache.hadoop.dfs.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1140)
      	at org.apache.hadoop.dfs.NameNode.addBlock(NameNode.java:300)
      	at org.apache.hadoop.dfs.NNThroughputBenchmark$BlockReportStats.addBlocks(NNThroughputBenchmark.java:786)
      	at org.apache.hadoop.dfs.NNThroughputBenchmark$BlockReportStats.generateInputs(NNThroughputBenchmark.java:775)
      	at org.apache.hadoop.dfs.NNThroughputBenchmark$OperationStatsBase.benchmark(NNThroughputBenchmark.java:203)
      	at org.apache.hadoop.dfs.NNThroughputBenchmark.runBenchmark(NNThroughputBenchmark.java:1035)
      	at org.apache.hadoop.dfs.NNThroughputBenchmark.main(NNThroughputBenchmark.java:1053)
      

      It looks like the problem is in NetworkTopology.chooseRandom(String, String), which returns null in certain cases, but the value returned is never checked for null.

      Attachments

        1. NullWriter.patch
          0.9 kB
          Hairong Kuang

        Issue Links

          Activity

            People

              hairong Hairong Kuang
              shv Konstantin Shvachko
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: