You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/09/29 17:02:34 UTC

[GitHub] [ozone] errose28 commented on a change in pull request #2684: HDDS-5786 datanode start failed due to empty datanode id file

errose28 commented on a change in pull request #2684:
URL: https://github.com/apache/ozone/pull/2684#discussion_r718705574



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/DatanodeIdYaml.java
##########
@@ -105,6 +106,12 @@ public static DatanodeDetails readDatanodeIdFile(File path)
           .setCurrentVersion(datanodeDetailsYaml.getCurrentVersion());
 
       datanodeDetails = builder.build();
+    } catch (NullPointerException e) {

Review comment:
       Handling an unchecked exception like this is usually bad practice. Especially in a large try/catch block like this where it's unclear what the cause is. Can we refactor this to explicitly handle the null reference before it is dereferenced?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org