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

BlocksMap.getStoredBlock(..) and BlockInfoUnderConstruction.addReplicaIfNotPresent(..) may throw NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.0, 3.0.0-alpha1
    • 2.3.0
    • namenode
    • None
    • Reviewed

    Description

      Found these NPEs in build #5849.

      • BlocksMap is accessed after close:
        2014-01-09 04:28:32,350 WARN  ipc.Server (Server.java:run(2060)) - IPC Server handler 2 on 58333, call org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.blockReceivedAndDeleted from 127.0.0.1:55572 Call#32 Retry#0: error: java.lang.NullPointerException
        java.lang.NullPointerException
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlocksMap.getStoredBlock(BlocksMap.java:113)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.processReportedBlock(BlockManager.java:1915)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.processAndHandleReportedBlock(BlockManager.java:2698)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.addBlock(BlockManager.java:2685)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.processIncrementalBlockReport(BlockManager.java:2759)
        	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.processIncrementalBlockReport(FSNamesystem.java:5321)
        	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.blockReceivedAndDeleted(NameNodeRpcServer.java:1018)
        	...
        
      • expectedLocation can be null.
        2014-01-09 04:28:35,384 WARN  ipc.Server (Server.java:run(2060)) - IPC Server handler 5 on 58333, call org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.blockReport from 127.0.0.1:55583 Call#47 Retry#0: error: java.lang.NullPointerException
        java.lang.NullPointerException
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockInfoUnderConstruction.addReplicaIfNotPresent(BlockInfoUnderConstruction.java:331)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.processFirstBlockReport(BlockManager.java:1801)
        	at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.processReport(BlockManager.java:1645)
        	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.blockReport(NameNodeRpcServer.java:987)
        	...
        

      Attachments

        1. HDFS-5747.01.patch
          2 kB
          Arpit Agarwal

        Issue Links

          Activity

            People

              arp Arpit Agarwal
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: