tomscut opened a new pull request #3784: URL: https://github.com/apache/hadoop/pull/3784
JIRA: [HDFS-16377](https://issues.apache.org/jira/browse/HDFS-16377). When starting the DN, we found NPE in the **staring DN's log**, as follows: ![image](https://user-images.githubusercontent.com/55134131/145567811-be577f4a-169b-40a8-b1b0-90ef69cc38ba.png) The logs of the **upstream DN** are as follows: ![image](https://user-images.githubusercontent.com/55134131/145567828-fe5677f3-6929-46b3-a095-9f0b10287961.png) This is mainly because `FsDatasetSpi` has not been initialized at the time of access. I noticed that checkNotNull is already done in these two method(`DataNode#getBlockLocalPathInfo` and `DataNode#getVolumeInfo`). So we should add it to other places(interfaces that clients and other DN can access directly) so that we can add a message(`Storage not yet initialized`) when throwing exceptions. Therefore, the client and the upstream DN know that `FsDatasetSpi` has not been initialized, rather than blindly unaware of the specific cause of the NPE. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org