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 "Hudson (JIRA)" <ji...@apache.org> on 2016/02/23 08:17:18 UTC
[jira] [Commented] (YARN-4709) NMWebServices produces incorrect
JSON for containers
[ https://issues.apache.org/jira/browse/YARN-4709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15158444#comment-15158444 ]
Hudson commented on YARN-4709:
------------------------------
FAILURE: Integrated in Hadoop-trunk-Commit #9345 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/9345/])
YARN-4709. NMWebServices produces incorrect JSON for containers. (vvasudev: rev 140cb5d74565aad848b40a251ec02b597a3a20d4)
* hadoop-yarn-project/CHANGES.txt
* hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServicesContainers.java
* hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/dao/ContainerInfo.java
* hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/WebServicesTestUtils.java
> NMWebServices produces incorrect JSON for containers
> ----------------------------------------------------
>
> Key: YARN-4709
> URL: https://issues.apache.org/jira/browse/YARN-4709
> Project: Hadoop YARN
> Issue Type: Bug
> Reporter: Varun Saxena
> Assignee: Varun Saxena
> Priority: Critical
> Fix For: 2.8.0
>
> Attachments: YARN-4709.01.patch, YARN-4709.02.patch
>
>
> Following exception is thrown when we run below command.
> {panel}
> root@varun-Inspiron-5558:/opt1/hadoop3/bin# ./yarn logs -applicationId application_1455999168135_0002 -am ALL -logFiles ALL
> Container: container_e31_1455999168135_0002_01_000001
> =======================================================
> {color:red}LogType:syslogstderrstdout
> Log Upload Time:Sun Feb 21 01:44:55 +0530 2016
> Log Contents:
> java.lang.Exception: Cannot find this log on the local disk.
> End of LogType:syslogstderrstdout{color}
> LogType:syslog
> Log Upload Time:Sun Feb 21 01:44:55 +0530 2016
> Log Contents:
> 2016-02-21 01:44:49,565 INFO \[main\] org.apache.hadoop.mapreduce.v2.app.MRAppMaster: Created MRAppMaster for application appattempt_1455999168135_0002_000001
> 2016-02-21 01:44:49,914 INFO \[main\] org.apache.hadoop.mapreduce.v2.app.MRAppMaster:
> /************************************************************
> {panel}
> This is because we annotate containerLogFiles list with XmlElementWrapper which generates XML output as under. And when we read this XML at client side, reading the value associated with containerLogFiles also leads to one value being syslogstderrstdout because both parent and child tags are same. This leads to the exception.
> {noformat}
> <containerLogFiles>
> <containerLogFiles>syslog</containerLogFiles>
> <containerLogFiles>stderr</containerLogFiles>
> <containerLogFiles>stdout</containerLogFiles>
> </containerLogFiles>
> {noformat}
> Moreover, as we use XMLElementWrapper, the JSON generated is as under. This JSON cannot be properly parsed by JSON parser(as a list). This is because child containerLogsFiles entries are treated as a key-value pair(map) and hence only last entry i.e. stdout is picked up. This was found while working on YARN-4517. This makes output unusable.
> This will be an issue for 2 REST endpoints i.e. {{/ws/v1/node/containers}} and {{/ws/v1/node/containers/\{\{containerId\}\}}}
> {noformat}
> "containerLogFiles":[
> {
> "containerLogFiles":"syslog",
> "containerLogFiles":"stderr",
> "containerLogFiles":"stdout"
> }
> ]
> {noformat}
> Ideally the JSON output should be as under.
> {noformat}
> "containerLogFiles":["syslog","stderr","stdout"]
> {noformat}
> We can indicate in the JAXB context to ignore the outer wrapper while marshalling to JSON. But this can only be done at class level. If we do so for ContainerInfo, it would break backward compatibility.
> Hence, to fix it we can remove XmlElementWrapper annotation for containerLogFiles list.
> Another solution would be to wrap the list inside another class.
> But going with former as of now as we do not specify XmlElementWrapper for lists at most of the places in our code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)