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

Ayush Saxena commented on TEZ-4473:
-----------------------------------

This Log in ideal situation shouldn't have got printed, because there was a 
check above the log line
{code:java}
    if (mdcKeys == null || mdcKeys.length == 0) {
      return;
    }
{code}
So, the expectation was if the conf isn't configured we will have either null 
or an empty array, but we were fetching the values via
{noformat}
String[] mdcKeys = conf.getStrings(TezConfiguration.TEZ_MDC_CUSTOM_KEYS,  
TezConfiguration.TEZ_MDC_CUSTOM_KEYS_DEFAULT);
{noformat}
We had passed a default value as well, which is an array with one element which 
is an empty string, so in case the conf isn't specified, it returns an array 
with first element as an empty string, which outsmarts this logic and we get 
that log

Have put up a PR removing this default param from getStrings() call

> Remove pointless MDC_LOGGING message from logs if there is no custom MDC key
> ----------------------------------------------------------------------------
>
>                 Key: TEZ-4473
>                 URL: https://issues.apache.org/jira/browse/TEZ-4473
>             Project: Apache Tez
>          Issue Type: Bug
>            Reporter: László Bodor
>            Assignee: Ayush Saxena
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
> 2023-02-10 12:42:35,251 INFO  [Thread-367] util.LoggingUtils 
> (LoggingUtils.java:initLoggingContext(58)) - MDC_LOGGING: setting up MDC 
> keys: keys: [] / conf: []
> 2023-02-10 12:42:35,251 WARN  [Thread-367] util.LoggingUtils 
> (LoggingUtils.java:initLoggingContext(65)) - cannot set mdc key: 
> {code}
> This 2 lines are confusing, keys: [] / conf: [] means we don't use the 
> feature introduced in TEZ-4039 at all



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to