Hexiaoqiao commented on code in PR #4198:
URL: https://github.com/apache/hadoop/pull/4198#discussion_r854980026


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java:
##########
@@ -522,10 +523,23 @@ private void 
handleAppSubmitEvent(AbstractDelegationTokenRenewerAppEvent evt)
           }  else {
             tokenConf = getConfig();
           }
-          dttr = new DelegationTokenToRenew(Arrays.asList(applicationId), 
token,
-              tokenConf, now, shouldCancelAtEnd, evt.getUser());
+          // decode identify to get maxDate.
+          TokenIdentifier tokenIdentifier = token.decodeIdentifier();

Review Comment:
   I think this is good improvement, especially for big and busy production 
cluster. IMO this changes is safe for HDFS, but I am not sure if it is proper 
for other system.
   Another way, just suggest to update 
org.apache.hadoop.yarn.server.resourcemanager.security.DelegationTokenRenewer#skipTokenRenewal
 rather than here to avoid double decode token. Also it is reasonable and 
readable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to