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

Xiao Chen commented on HDFS-12726:
----------------------------------

To be specific, {{debugLoggingBuilder}} itself not {{toString}} should be fine, 
since the log is done by the local var builder:
{code}
    builder = debugLoggingBuilder.get();
    ....
    if (numOfReplicas>0) {
      String detail = enableDebugLogging;
      if (LOG.isDebugEnabled()) {
        if (badTarget && builder != null) {
          detail = builder.toString();
          builder.setLength(0);
        } else {
          detail = "";
        }
      }
      throw new NotEnoughReplicasException(detail);
    }
{code}
But when should the {{detail}} be logged should be investigated. At least for 
the unit test in HDFS-12725, nothing is there. This is inconvenient to 
debugging at least, since {{logNodeIsNotChosen}} is then a no-op.

> BlockPlacementPolicyDefault's debugLoggingBuilder is not logged
> ---------------------------------------------------------------
>
>                 Key: HDFS-12726
>                 URL: https://issues.apache.org/jira/browse/HDFS-12726
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: logging
>            Reporter: Xiao Chen
>              Labels: supportability
>
> During debugging HDFS-12725, {{BlockPlacementPolicyDefault's}} class' 
> {{debugLoggingBuilder}} does a lot of {{get}} and {{append}}, but never 
> {{toString}} and {{LOG.debug}}'ed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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