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

Varun Saxena commented on YARN-5286:
------------------------------------

Thanks [~hex108] for the patch.
I think we can reuse RMAppAttempt object used for getting master container in 
{{getAmRPCAddressFromRMApp}} instead of getting current attempt again.
Moreover in getAmRPCAddressFromRMApp, we can store host and RPC port in a local 
variable or move this logic of generating AM RPC address to RMAppAttemptImpl 
and put it inside read lock. Reason being that in code below, host and rpc port 
may change between check for N/A and -1 and populating amRPCAddress if attempt 
fails in between. This may lead to an inconsistent response back to client.
{code}
if (attempt != null && !"N/A".equals(attempt.getHost())
        && attempt.getRpcPort() != -1) {
      amRPCAddress = attempt.getHost() + ":" + attempt.getRpcPort();
    }
{code}

> Add RPC port info in RM web service's response when getting app status
> ----------------------------------------------------------------------
>
>                 Key: YARN-5286
>                 URL: https://issues.apache.org/jira/browse/YARN-5286
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Jun Gong
>            Assignee: Jun Gong
>         Attachments: YARN-5286.01.patch, YARN-5286.02.patch, 
> YARN-5286.03.patch, YARN-5286.04.patch
>
>
> When getting app status by RM web service({{/ws/v1/cluster/apps/\{appid\}}}), 
> there is no RPC port info in the response. The port info is very important to 
> communicate with AM.
> BTW: there is RPC port info when running {{bin/yarn application -status 
> appid}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to