zuston commented on code in PR #4198:
URL: https://github.com/apache/hadoop/pull/4198#discussion_r857222530
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java:
##########
@@ -491,12 +492,13 @@ private void
handleAppSubmitEvent(AbstractDelegationTokenRenewerAppEvent evt)
Set<DelegationTokenToRenew> tokenList = new
HashSet<DelegationTokenToRenew>();
boolean hasHdfsToken = false;
for (Token<?> token : tokens) {
+ AtomicLong tokenExpiredTime = new AtomicLong(now);
if (token.isManaged()) {
if (token.getKind().equals(HDFS_DELEGATION_KIND)) {
LOG.info(applicationId + " found existing hdfs token " + token);
hasHdfsToken = true;
}
- if (skipTokenRenewal(token)) {
+ if (skipTokenRenewal(token, tokenExpiredTime)) {
Review Comment:
The var of `tokenExpiredTime` will be changed in the method of
`skipTokenRenewal`, however we can't found it according to its method name
directly. Maybe `skipTokenRenewal` should be renamed to
`skipTokenRenewalAndUpdateExpiredTime`.
##########
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 +634,7 @@ private boolean skipTokenRenewal(Token<?> token)
if (identifier == null) {
return false;
}
+ expiredTime.set(identifier.getMaxDate());
Review Comment:
Do we just to reset the expireTime only when the result of
`skipTokenRenewal` is false?
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java:
##########
@@ -535,7 +541,7 @@ private void
handleAppSubmitEvent(AbstractDelegationTokenRenewerAppEvent evt)
+ " on recovery as it expired, requesting new hdfs token for
"
+ applicationId + ", user=" + evt.getUser(), ioe);
requestNewHdfsDelegationTokenAsProxyUser(
- Arrays.asList(applicationId), evt.getUser(),
+ Collections.singletonList(applicationId), evt.getUser(),
Review Comment:
Why do this change? Please let me what u think thanks
--
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]