YARN-6263. NMTokenSecretManagerInRM.createAndGetNMToken is not thread safe. Contributed by Haibo Chen
(cherry picked from commit e58fc7603053e3ac1bc2464f9622995017db5245)
This commit is contained in:
parent
9b949f49e3
commit
5eca427da2
@ -192,7 +192,7 @@ public void run() {
|
||||
public NMToken createAndGetNMToken(String applicationSubmitter,
|
||||
ApplicationAttemptId appAttemptId, Container container) {
|
||||
try {
|
||||
this.readLock.lock();
|
||||
this.writeLock.lock();
|
||||
HashSet<NodeId> nodeSet = this.appAttemptToNodeKeyMap.get(appAttemptId);
|
||||
NMToken nmToken = null;
|
||||
if (nodeSet != null) {
|
||||
@ -208,7 +208,7 @@ public NMToken createAndGetNMToken(String applicationSubmitter,
|
||||
}
|
||||
return nmToken;
|
||||
} finally {
|
||||
this.readLock.unlock();
|
||||
this.writeLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user