steveloughran commented on a change in pull request #1894:
URL: https://github.com/apache/hadoop/pull/1894#discussion_r592451348
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
##########
@@ -356,16 +356,14 @@ private void updateCurrentKey() throws IOException {
int newCurrentId;
synchronized (this) {
newCurrentId = incrementCurrentKeyId();
- }
- DelegationKey newKey = new DelegationKey(newCurrentId, System
- .currentTimeMillis()
- + keyUpdateInterval + tokenMaxLifetime, generateSecret());
- //Log must be invoked outside the lock on 'this'
- logUpdateMasterKey(newKey);
- synchronized (this) {
- currentKey = newKey;
+ currentKey = new DelegationKey(newCurrentId, System
+ .currentTimeMillis()
+ + keyUpdateInterval + tokenMaxLifetime, generateSecret());
+
storeDelegationKey(currentKey);
}
+ //Log must be invoked outside the lock on 'this'
+ logUpdateMasterKey(currentKey);
Review comment:
so this is now happening after the store? And both generateSecret and
store are now synchronized?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]