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

Jian He commented on MAPREDUCE-6838:
------------------------------------

- The comment says is OR condition where as the code is AND, which one is true 
? Also, when will the "delegationToken.getService()" be empty ? looks like the 
NodeTimelineCollectorManager#generateTokenAndSetTimer is always setting the 
service field.
{code}
    // Token need not be updated if either address or token service does not
    // exist.
    String service = delegationToken.getService();
    if ((service == null || service.isEmpty()) &&
        (collectorAddr == null || collectorAddr.isEmpty())) {
      LOG.warn("Timeline token does not have service and timeline service " +
          "address is not yet set. Not updating the token");
      return;
    }
{code}

- Here if this method is called for the first time, timelineServiceAddress is 
null, and collectorAddr is null 
{code}
    if (collectorAddr == null || collectorAddr.isEmpty()) {
      collectorAddr = timelineServiceAddress;
    }
{code}
 later here, it uses "SecurityUtil.getTokenServiceAddr(timelineToken)" to set 
the token service.  Then next time collectorAddr is not null because 
timelineServiceAddress is not null, it always call 
"NetUtils.createSocketAddr(collectorAddr) " to set the token service. Is my 
understanding correct?  why not just consistently use one of them to make it 
look simpler?
{code}
    // Prefer timeline service address over service coming in the token for
    // updating the token service.
    InetSocketAddress serviceAddr =
        (collectorAddr != null && !collectorAddr.isEmpty()) ?
        NetUtils.createSocketAddr(collectorAddr) :
        SecurityUtil.getTokenServiceAddr(timelineToken);
    SecurityUtil.setTokenService(timelineToken, serviceAddr);
    authUgi.addToken(timelineToken);
{code}
- Does the collector address change if NM restarts? If so, we may have two 
keys(different address) for two tokens in the UGI. 



> [ATSv2 Security] Add timeline delegation token received in allocate response 
> to UGI
> -----------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-6838
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6838
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>              Labels: yarn-5355-merge-blocker
>             Fix For: YARN-5355
>
>         Attachments: MAPREDUCE-6838-YARN-5355.01.patch, 
> MAPREDUCE-6838-YARN-5355.02.patch, MAPREDUCE-6838-YARN-5355.03.patch, 
> MAPREDUCE-6838-YARN-5355.04.patch, MAPREDUCE-6838-YARN-5355.05.patch, 
> MAPREDUCE-6838-YARN-5355.06.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-h...@hadoop.apache.org

Reply via email to