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

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

huangzhaobo99 commented on code in PR #6323:
URL: https://github.com/apache/hadoop/pull/6323#discussion_r1438904713


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:
##########
@@ -1423,9 +1420,7 @@ private static boolean format(Configuration conf, boolean 
force,
       LOG.warn("Encountered exception during format", ioe);
       throw ioe;
     } finally {
-      if (fsImage != null) {
-        fsImage.close();
-      }
+      fsImage.close();

Review Comment:
   Happy New Year, Everybody!
   
   Leave some minor opinions, we can use the try-with-resources.
   there are still some invalid variables that cause some warnings in the test 
report, If necessary, I can optimize it here. cc @tasanuma 





> Delete invalid code logic in namenode format
> --------------------------------------------
>
>                 Key: HDFS-17277
>                 URL: https://issues.apache.org/jira/browse/HDFS-17277
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: zhangzhanchang
>            Assignee: zhangzhanchang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.4.0, 3.3.9
>
>
> There is invalid logical processing in the namenode format process



--
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