hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akira Ajisaka (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10571) Use Log.*(Object, Throwable) overload to log exceptions
Date Tue, 13 Feb 2018 09:40:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-10571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16362053#comment-16362053

Akira Ajisaka commented on HADOOP-10571:

Thanks [~boky01] for continuing the work! Overall looks good. Minor comments from me:
 * DNS.java L434: {{e.getMessage()}} still exists. It can be replaced with {{LOG.*(Object,
 * AbstractService.java L257: Should it be {{LOG.debug("notefailure ", exception)}}?
 * OpenFileCtx.java L709, L747, and L1233: Can we avoid {{e.toString()}}?
 * OpenFileCtx.java and RpcProgramNfs3.java: {{handle.dumpFileHandle()}} contains string concatenation,
so I'm thinking it should be guarded with {{LOG.isDebugEnabled()}}.
 * OpenFileCtx.java L1113: It should be guarded with {{LOG.isDebugEnabled()}} to avoid calling
 * OpenFileCtx.java L2214: {{LOG.debug(Nfs3Utils.READ_RPC_START + xid)}} should be replaced
with {{LOG.debug("{}{}", Nfs3Utils.READ_RPC_START, xid)}}. Similar issues are in L2216 and
 * DataNode.java L1939: {{id.toString()}} can be replaced with {{id}}.
 * DataNode.java L2436: {{Arrays.asList}} seems costly, so it should be guarded with {{isDebugEnabled()}}.
 * DataNode.java L2726: Can we avoid {{ex.toString()}}?
 * DataXceiver.java L304 and L313: Can we avoid {{t.toString()}}?
 * DataXceiver.java L922, L961, L997, L1039, and L1100: Can we avoid {{ioe.toString()}}?
 * Gridmix.java L203: {{inputDir.toString()}} can be replaced with {{inputDir}}.

> Use Log.*(Object, Throwable) overload to log exceptions
> -------------------------------------------------------
>                 Key: HADOOP-10571
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10571
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Arpit Agarwal
>            Assignee: Andras Bokor
>            Priority: Major
>         Attachments: HADOOP-10571.01.patch, HADOOP-10571.01.patch, HADOOP-10571.02.patch,
HADOOP-10571.03.patch, HADOOP-10571.04.patch, HADOOP-10571.05.patch, HADOOP-10571.06.patch
> When logging an exception, we often convert the exception to string or call {{.getMessage}}.
Instead we can use the log method overloads which take {{Throwable}} as a parameter.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message