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

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

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


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java:
##########
@@ -1201,7 +1200,7 @@ private void lostFoundInit(DFSClient dfs) {
         lfInitedOk = true;
       }
     }  catch (Exception e) {
-      e.printStackTrace();
+      LOG.error(lfName + " dir init failed.", e);
       lfInitedOk = false;
     }

Review Comment:
   Thank you for your guidance. It seems better to throw out exceptions so that 
the Client can also perceive specific exception information. I will immediately 
modify it





> 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
>
>
> 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-05-15-41-38-420.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