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

ASF GitHub Bot commented on HDFS-17298:
---------------------------------------

haiyang1987 opened a new pull request, #6374:
URL: https://github.com/apache/hadoop/pull/6374

   ### Description of PR
   https://issues.apache.org/jira/browse/HDFS-17298
   
   There are some NPE issues on the DataNode side of our online environment.
   
   The detailed exception information is
   
   ```
   2023-12-20 13:58:25,449 ERROR datanode.DataNode (DataXceiver.java:run(330)) 
[DataXceiver for client DFSClient_NONMAPREDUCE_xxx at /xxx:41452 [Sending block 
BP-xxx:blk_xxx]] - xxx:50010:DataXceiver error processing READ_BLOCK operation  
src: /xxx:41452 dst: /xxx:50010
   java.lang.NullPointerException
           at 
org.apache.hadoop.hdfs.server.datanode.BlockSender.<init>(BlockSender.java:301)
           at 
org.apache.hadoop.hdfs.server.datanode.DataXceiver.readBlock(DataXceiver.java:607)
           at 
org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opReadBlock(Receiver.java:152)
           at 
org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:104)
           at 
org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:298)
           at java.lang.Thread.run(Thread.java:748)
   ```
   NPE Code logic:
   
   ```
   if (!fromScanner && blockScanner.isEnabled()) {
     // data.getVolume(block) is null
     blockScanner.markSuspectBlock(data.getVolume(block).getStorageID(),
         block);
   } 
   ```
   
   ```
   2023-12-20 13:52:18,844 ERROR datanode.DataNode (DataXceiver.java:run(330)) 
[DataXceiver for client /xxx:61052 [Copying block BP-xxx:blk_xxx]] - 
xxx:50010:DataXceiver error processing COPY_BLOCK operation  src: /xxx:61052 
dst: /xxx:50010
   java.lang.NullPointerException
           at 
org.apache.hadoop.hdfs.server.datanode.DataNode.handleBadBlock(DataNode.java:4045)
           at 
org.apache.hadoop.hdfs.server.datanode.DataXceiver.copyBlock(DataXceiver.java:1163)
           at 
org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opCopyBlock(Receiver.java:291)
           at 
org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:113)
           at 
org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:298)
           at java.lang.Thread.run(Thread.java:748)
   ```
   NPE Code logic:
   
   ```
   // Obtain a reference before reading data
   volumeRef = datanode.data.getVolume(block).obtainReference(); 
//datanode.data.getVolume(block) is null  
   We need to fix it.
   ```




> Fix NPE in DataNode.handleBadBlock and BlockSender
> --------------------------------------------------
>
>                 Key: HDFS-17298
>                 URL: https://issues.apache.org/jira/browse/HDFS-17298
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>
> There are some NPE issues on the DataNode side of our online environment.
> The detailed exception information is
> {code:java}
> 2023-12-20 13:58:25,449 ERROR datanode.DataNode (DataXceiver.java:run(330)) 
> [DataXceiver for client DFSClient_NONMAPREDUCE_xxx at /xxx:41452 [Sending 
> block BP-xxx:blk_xxx]] - xxx:50010:DataXceiver error processing READ_BLOCK 
> operation  src: /xxx:41452 dst: /xxx:50010
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hdfs.server.datanode.BlockSender.<init>(BlockSender.java:301)
>         at 
> org.apache.hadoop.hdfs.server.datanode.DataXceiver.readBlock(DataXceiver.java:607)
>         at 
> org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opReadBlock(Receiver.java:152)
>         at 
> org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:104)
>         at 
> org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:298)
>         at java.lang.Thread.run(Thread.java:748)
> {code}
> NPE Code logic:
> {code:java}
> if (!fromScanner && blockScanner.isEnabled()) {
>   // data.getVolume(block) is null
>   blockScanner.markSuspectBlock(data.getVolume(block).getStorageID(),
>       block);
> } 
> {code}
> {code:java}
> 2023-12-20 13:52:18,844 ERROR datanode.DataNode (DataXceiver.java:run(330)) 
> [DataXceiver for client /xxx:61052 [Copying block BP-xxx:blk_xxx]] - 
> xxx:50010:DataXceiver error processing COPY_BLOCK operation  src: /xxx:61052 
> dst: /xxx:50010
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hdfs.server.datanode.DataNode.handleBadBlock(DataNode.java:4045)
>         at 
> org.apache.hadoop.hdfs.server.datanode.DataXceiver.copyBlock(DataXceiver.java:1163)
>         at 
> org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opCopyBlock(Receiver.java:291)
>         at 
> org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:113)
>         at 
> org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:298)
>         at java.lang.Thread.run(Thread.java:748)
> {code}
> NPE Code logic:
> {code:java}
> // Obtain a reference before reading data
> volumeRef = datanode.data.getVolume(block).obtainReference(); 
> //datanode.data.getVolume(block) is null  
> {code}
> We need to fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to