diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index b0f5038eb1a..e1730ca8a77 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -652,6 +652,9 @@ Release 2.6.0 - UNRELEASED HADOOP-11175. Fix several issues of hadoop security configuration in user doc. (Yi Liu via cnauroth) + HADOOP-11122. Fix findbugs in ZK DelegationTokenSecretManagers. + (Arun Suresh via kasha) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES 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 7b6bf351a93..ebba6a192a6 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 @@ -163,11 +163,6 @@ extends AbstractDelegationTokenIdentifier> return; } - // for ZK based secretManager - protected void updateMasterKey(DelegationKey key) throws IOException{ - return; - } - // RM protected void removeStoredMasterKey(DelegationKey key) { return; @@ -191,7 +186,7 @@ extends AbstractDelegationTokenIdentifier> * For subclasses externalizing the storage, for example Zookeeper * based implementations */ - protected int getDelegationTokenSeqNum() { + protected synchronized int getDelegationTokenSeqNum() { return delegationTokenSequenceNumber; } @@ -199,7 +194,7 @@ extends AbstractDelegationTokenIdentifier> * For subclasses externalizing the storage, for example Zookeeper * based implementations */ - protected int incrementDelegationTokenSeqNum() { + protected synchronized int incrementDelegationTokenSeqNum() { return ++delegationTokenSequenceNumber; } @@ -207,7 +202,7 @@ extends AbstractDelegationTokenIdentifier> * For subclasses externalizing the storage, for example Zookeeper * based implementations */ - protected void setDelegationTokenSeqNum(int seqNum) { + protected synchronized void setDelegationTokenSeqNum(int seqNum) { delegationTokenSequenceNumber = seqNum; } @@ -234,7 +229,6 @@ extends AbstractDelegationTokenIdentifier> */ protected void updateDelegationKey(DelegationKey key) throws IOException { allKeys.put(key.getKeyId(), key); - updateMasterKey(key); } /** diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java index 23c71445017..5f688447b37 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/ZKDelegationTokenSecretManager.java @@ -276,7 +276,7 @@ public abstract class ZKDelegationTokenSecretManager