diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java index cafa5135e6..8378a47ced 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java @@ -81,7 +81,12 @@ class AbstractDelegationTokenSecretManager expiredTokens = new HashSet(); + expiredTokens.add(dtId); + setRules("RULE:[2:$1@$0](OtherUser.*)s/.*/OtherUser/"); + //rules was modified, causing the existing tokens + //(May be loaded from other storage systems like zookeeper) to fail to match the kerberos rules, + //return an exception that cannot be handled + new AbstractDelegationTokenSecretManager(10 * 1000, 10 * 1000, + 10 * 1000, 10 * 1000) { + @Override + public DelegationTokenIdentifier createIdentifier() { + return null; + } + public void logExpireTokens(Collection expiredTokens) + throws IOException { + super.logExpireTokens(expiredTokens); + } + }.logExpireTokens(expiredTokens); + } }