[ https://issues.apache.org/jira/browse/HDFS-13321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411512#comment-16411512 ]
ASF GitHub Bot commented on HDFS-13321: --------------------------------------- GitHub user lzh3636 opened a pull request: https://github.com/apache/hadoop/pull/357 HDFS-13321: Inadequate information for handling catch clauses The description of the problem: https://issues.apache.org/jira/browse/HDFS-13321 I just added stack traces information to those two logging statements, so that the exception type can be generated to the logs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/lzh3636/hadoop HDFS-13321 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/357.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #357 ---- commit 958aa66832714c95cb2fc643b66245401f4c5aa1 Author: lzh3636 <lizi422@...> Date: 2018-03-23T14:52:24Z Update BPServiceActor.java Add stack traces to logging statements ---- > Inadequate information for handling catch clauses > ------------------------------------------------- > > Key: HDFS-13321 > URL: https://issues.apache.org/jira/browse/HDFS-13321 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 3.0.0 > Reporter: Zhenhao Li > Priority: Major > Labels: easyfix > > Their are some situations that different exception types are caught, but the > handling of those exceptions can not show the differences of those types. > Here are the code snippets we found which have this problem: > *hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java* > [https://github.com/apache/hadoop/blob/bec79ca2495abdc347d64628151c90f5ce777046/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java] > At Line *233* and Line *235.* We can see that two exception types are caught, > but the logging statements here can not show the exception type at all. > Also there are comments for these two catch clauses respectively, one is > "{color:#707070}// namenode is busy{color}", the other one is > "{color:#707070}// namenode is not available",{color:#333333} but the log > messages are too generic, can not show the "busy" or "not available" of > namenode.{color}{color} > It may cause confusions to the person who is reading the log, the person can > not know what exception happened here and can not distinguish logs generated > by these two statements. > Maybe adding stack trace information to these two logging statements and > change the log message to handle specific situations is a simple way to > improve it. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org