You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/05/22 14:41:21 UTC

[GitHub] [hadoop] Hexiaoqiao commented on a diff in pull request #4198: YARN-11112 Avoid renewing delegation token when app is first submitte…

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


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java:
##########
@@ -523,9 +528,14 @@ private void handleAppSubmitEvent(AbstractDelegationTokenRenewerAppEvent evt)
             tokenConf = getConfig();
           }
           dttr = new DelegationTokenToRenew(Arrays.asList(applicationId), token,
-              tokenConf, now, shouldCancelAtEnd, evt.getUser());
+              tokenConf, tokenExpiredTime.get(), shouldCancelAtEnd, evt.getUser());
+
           try {
-            renewToken(dttr);
+            // if expire date is not greater than now, renew token.
+            // add extra time in case of clock skew
+            if (tokenExpiredTime.get() <= now + clockSkewExtraTime) {

Review Comment:
   Sorry I didn't get why add clock skew condition check here. I think we should file another JIRA to fix if it is issue indeed.



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java:
##########
@@ -627,6 +638,7 @@ private boolean skipTokenRenewal(Token<?> token)
     if (identifier == null) {
       return false;
     }
+    expiredTime.set(identifier.getMaxDate());
     Text renewer = identifier.getRenewer();
     return (renewer != null && renewer.toString().equals(""));

Review Comment:
   Just suggest to check if delegation token need to renew while app is just submitted.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org