Skip to content

Commit ac436dd

Browse files
ZanderXuHarshitGupta11
authored andcommitted
HDFS-16704. Datanode return empty response instead of NPE for GetVolumeInfo during restarting (apache#4661). Contributed by ZanderXu.
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
1 parent 8db5e71 commit ac436dd

File tree

1 file changed

+4
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode

1 file changed

+4
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3628,7 +3628,10 @@ public String getBPServiceActorInfo() {
36283628
*/
36293629
@Override // DataNodeMXBean
36303630
public String getVolumeInfo() {
3631-
Preconditions.checkNotNull(data, "Storage not yet initialized");
3631+
if (data == null) {
3632+
LOG.debug("Storage not yet initialized.");
3633+
return "";
3634+
}
36323635
return JSON.toString(data.getVolumeInfoMap());
36333636
}
36343637

0 commit comments

Comments
 (0)