hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiaoyu Yao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-8840) Inconsistent log level practice
Date Sun, 02 Aug 2015 14:37:04 GMT

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

Xiaoyu Yao commented on HDFS-8840:
----------------------------------

There isn't much need for isFatalEnabled() check as we don't want to turn them off anyway.
If you check the Hadoop code, you will find that we never to that for LOG.fatal().

> Inconsistent log level practice
> -------------------------------
>
>                 Key: HDFS-8840
>                 URL: https://issues.apache.org/jira/browse/HDFS-8840
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 2.6.0, 2.5.1, 2.5.2, 2.7.1
>            Reporter: songwanging
>            Assignee: Jagadesh Kiran N
>            Priority: Minor
>         Attachments: HDFS-8840-00.patch
>
>
> In method "checkLogsAvailableForRead()" of class: hadoop-2.7.1-src\hadoop-hdfs-project\hadoop-hdfs\src\main\java\org\apache\hadoop\hdfs\server\namenode\ha\BootstrapStandby.java
> The log level is not correct, after checking "LOG.isDebugEnabled()", we should use "LOG.debug(msg,
e);", while now we use " LOG.fatal(msg, e);". Log level is inconsistent.
> the source code of this method is:
> private boolean checkLogsAvailableForRead(FSImage image, long imageTxId, long curTxIdOnOtherNode)
{
>   ...
>     } catch (IOException e) {
>    ...
>       if (LOG.isDebugEnabled()) {
>         LOG.fatal(msg, e);
>       } else {
>         LOG.fatal(msg);
>       }
>       return false;
>     }
>   }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message