You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Anuhan Torgonshar (JIRA)" <ji...@apache.org> on 2019/03/07 01:09:00 UTC

[jira] [Created] (YARN-9350) Change log level to WARN when ShellCommandExecutor.execute() occurs exception

Anuhan Torgonshar created YARN-9350:
---------------------------------------

             Summary: Change log level to WARN when ShellCommandExecutor.execute() occurs exception 
                 Key: YARN-9350
                 URL: https://issues.apache.org/jira/browse/YARN-9350
             Project: Hadoop YARN
          Issue Type: Improvement
          Components: yarn
    Affects Versions: 2.8.5, 3.1.0
            Reporter: Anuhan Torgonshar
         Attachments: NodeHealthScriptRunner.java, PrivilegedOperationExecutor.java, WindowsBasedProcessTree.java

When method ShellCommandExecutor.execute() occurs exception , it has inconsistent log level practices in different places as following :
{code:java}
//hadoop-2.8.5-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-common\src\main\java\org\apache\hadoop\yarn\util\WindowsBasedProcessTree.java
//log statement line number:69
//log level:error
try {
   shellExecutor.execute();
} catch (IOException e) {
   LOG.error(StringUtils.stringifyException(e));
} finally {
   String output = shellExecutor.getOutput();
   if (output != null &&
   output.contains("Prints to stdout a list of processes in the task")) {
   return true;
}

//hadoop-2.8.5-src\hadoop-common-project\hadoop-common\src\main\java\org\apache\hadoop\util\NodeHealthScriptRunner.java
//log statement line number:116
//log level:warn
try {
  shexec.execute();
} catch (ExitCodeException e) {
  ......
} catch (Exception e) {
   LOG.warn("Caught exception : " + e.getMessage());
   if (!shexec.isTimedOut()) {
     status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION;
   } else {
     status = HealthCheckerExitStatus.TIMED_OUT;
   }
   exceptionStackTrace = StringUtils.stringifyException(e);
} finally {
   ......
}

//hadoop-2.8.5-src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-nodemanager\src\main\java\org\apache\hadoop\yarn\server\nodemanager\containermanager\linux\privileged\PrivilegedOperationExecutor.java
//log statement line number:179
//log level:warn
try {
   exec.execute();
   if (LOG.isDebugEnabled()) {
     LOG.debug("command array:");
     LOG.debug(Arrays.toString(fullCommandArray));
     LOG.debug("Privileged Execution Operation Output:");
     LOG.debug(exec.getOutput());
   }
} catch (ExitCodeException e) {
   ......
} catch (IOException e) {
LOG.warn("IOException executing command: ", e);
throw new PrivilegedOperationException(e);
}{code}
There are 2 similar code snippets assign WARN level, when execute() occurs exception, simultaneously only 1 code snippet chooses ERROR level for same situation. Therefore, I think this one log statement is more likely to be assigned WARN level.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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