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

ASF GitHub Bot commented on YARN-11897:
---------------------------------------

Hean-Chhinling opened a new pull request, #8227:
URL: https://github.com/apache/hadoop/pull/8227

   … upgrade
   
   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   Retrieving the logs for a running application fails as the logs CLI expects 
a JSON object as a response when calling the NM REST API, and it provides a 
JSON Array
   
   Actual response with Jersey 2:
   ```
   [
     {
       "containerLogsInfo": {
         "containerLogInfo": [
           {
             "fileName": "stderr",
             "fileSize": "0",
             "lastModifiedTime": "Wed Nov 12 13:26:19 +0000 2025"
           },
           ...
         ],
         "logAggregationType": "LOCAL",
         "containerId": "container_e80_1762940127665_0015_01_000003",
         "nodeId": "ccycloud-2.native-moxy4.root.comops.site:8041"
       }
     }
   ]
   
   ```
   Expected response with Jersey 1:
   ```
   {
     "containerLogsInfo": [
       {
         "containerLogInfo": {
           "fileName": "logfile1",
           "fileSize": "12",
           "lastModifiedTime": "Thu Nov 13 13:11:14 +0100 2025"
         },
         "logAggregationType": "LOCAL",
         "containerId": "container_0_0000_00_000000",
         "nodeId": "testhost.foo.com:8042"
       },
       {
         "containerLogInfo": {
           "fileName": "logfile1-aggregated",
           "fileSize": "23",
           "lastModifiedTime": "Thu Nov 13 13:11:14 +0100 2025"
         },
         "logAggregationType": "AGGREGATED",
         "containerId": "container_0_0000_00_000000",
         "nodeId": "testhost.foo.com_8042"
       }
     ]
   }
   ```
   
   ### How was this patch tested?
   Tested on a cluster:
   
   - Logs CLI works for running/finished applications
   - UI v2 works when loading containers for a node
   
   Response format for `/ws/v1/node/containers/{container-id}/logs` endpoint 
seems compatible with the Jersey 1 format comparing them with a nightly version:
   
   **JSON**:
   ```
   {
     "containerLogsInfo": [
       {
         "containerLogInfo": [
           {
             "fileName": "stderr",
             "fileSize": "0",
             "lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
           },
           {
             "fileName": "prelaunch.err",
             "fileSize": "0",
             "lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
           },
           {
             "fileName": "prelaunch.out",
             "fileSize": "70",
             "lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
           },
           {
             "fileName": "stdout",
             "fileSize": "0",
             "lastModifiedTime": "Wed Nov 19 08:40:57 +0000 2025"
           }
         ],
         "logAggregationType": "LOCAL",
         "containerId": "container_e87_1763463022925_0008_01_000003",
         "nodeId": "ccycloud-2.native-moxy4.root.comops.site:8041"
       }
     ]
   }
   ```
   **XML**:
   ```
   <containerLogsInfoes>
      <containerLogsInfo>
         <containerLogInfo>
            <fileName>stderr</fileName>
            <fileSize>0</fileSize>
            <lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
         </containerLogInfo>
         <containerLogInfo>
            <fileName>prelaunch.err</fileName>
            <fileSize>0</fileSize>
            <lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
         </containerLogInfo>
         <containerLogInfo>
            <fileName>prelaunch.out</fileName>
            <fileSize>70</fileSize>
            <lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
         </containerLogInfo>
         <containerLogInfo>
            <fileName>stdout</fileName>
            <fileSize>0</fileSize>
            <lastModifiedTime>Wed Nov 19 14:43:16 +0000 2025</lastModifiedTime>
         </containerLogInfo>
         <logAggregationType>LOCAL</logAggregationType>
         <containerId>container_e88_1763555032540_0004_01_000003</containerId>
         <nodeId>ccycloud-2.native-moxy4.root.comops.site:8041</nodeId>
      </containerLogsInfo>
   </containerLogsInfoes>
   ```
   
   
   ### For code changes:
   
   - [ ] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   ### AI Tooling
   
   If an AI tool was used:
   
   - [ ] The PR includes the phrase "Contains content generated by <tool>"
         where <tool> is the name of the AI tool used.
   - [ ] My use of AI contributions follows the ASF legal policy
         https://www.apache.org/legal/generative-tooling.html




> NodeManager REST API backward compatibility with Jersey1
> --------------------------------------------------------
>
>                 Key: YARN-11897
>                 URL: https://issues.apache.org/jira/browse/YARN-11897
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: yarn
>    Affects Versions: 3.5.0
>            Reporter: Peter Szucs
>            Assignee: chhinlinghean
>            Priority: Major
>
> Jersey 2 upgrade broke NM REST API, so nodes applications page is not 
> rendering in yarn UI v2 and also logs CLI cannot retrieve container logs.
> To fix this we need to:
>  * introduce moxy in NM similar to YARN-11874
>  * "/containers/\{containerid}/logs" endpoint returns a list, which will 
> always be generated as a JSON array with Jersey 2. In Jersey 1 it returned a 
> JSON object in case the list had a single element, and logs CLI expects a 
> JSON object as well when calling this endpoint. That should be changed to 
> keep backward compatibility. With returning a wrapper object instead of a 
> list we could achieve the same behaviour.
>  * Fix unit tests



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to