Skip to content

Commit 06ff1b6

Browse files
authored
YARN-11384: NPE in DelegationTokenRenewer causes all subsequent apps to fail with "Timer already cancelled" (#7404) Contributed by Cheng Pan.
Reviewed-by: Shilun Fan <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 744fe66 commit 06ff1b6

File tree

1 file changed

+6
-3
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security

1 file changed

+6
-3
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/security/DelegationTokenRenewer.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,13 @@ private void cancelToken(DelegationTokenToRenew t) {
807807
private void removeFailedDelegationToken(DelegationTokenToRenew t) {
808808
Collection<ApplicationId> applicationIds = t.referringAppIds;
809809
synchronized (applicationIds) {
810-
LOG.error("removing failed delegation token for appid=" + applicationIds
811-
+ ";t=" + t.token.getService());
810+
LOG.error("removing failed delegation token for appid={};t={}",
811+
applicationIds, t.token.getService());
812812
for (ApplicationId applicationId : applicationIds) {
813-
appTokens.get(applicationId).remove(t);
813+
Set<DelegationTokenToRenew> tokens = appTokens.get(applicationId);
814+
if (tokens != null && !tokens.isEmpty()) {
815+
tokens.remove(t);
816+
}
814817
}
815818
}
816819
allTokens.remove(t.token);

0 commit comments

Comments
 (0)