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

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

xiaojunxiang2023 commented on code in PR #6709:
URL: https://github.com/apache/hadoop/pull/6709#discussion_r1554813666


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java:
##########
@@ -1201,7 +1201,9 @@ private void lostFoundInit(DFSClient dfs) {
         lfInitedOk = true;
       }
     }  catch (Exception e) {
-      e.printStackTrace();
+      if (!lfInitedOk) {
+        throw new IOException("failed to initialize " + lfName);

Review Comment:
   ok, It seems better not use catch. 





> Fix namenode fsck swallows the exception stacktrace, this can help us to 
> troubleshooting log.
> ---------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17454
>                 URL: https://issues.apache.org/jira/browse/HDFS-17454
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 3.3.6
>            Reporter: xiaojunxiang
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: image-2024-04-05-15-40-37-147.png, 
> image-2024-04-05-15-41-38-420.png, image-2024-04-06-17-51-49-316.png, 
> image-2024-04-06-17-51-54-356.png
>
>
> When I used `hdfs fsck /xxx.txt -move`, missing error, but I can't kown the 
> reason, because the exception stacktrace doesn't append to LOG, original code:
> !image-2024-04-05-15-40-37-147.png!
>  
> When I fix it, look, we can see the exception stacktrace:
> !image-2024-04-06-17-51-49-316.png!!image-2024-04-06-17-51-54-356.png!



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