YARN-5353. ResourceManager can leak delegation tokens when they are shared across apps. (Jason Lowe via Varun Saxena).
This commit is contained in:
parent
c454639abf
commit
954dac6860
|
@ -18,6 +18,9 @@ Release 2.7.4 - UNRELEASED
|
||||||
YARN-4393. Fix intermittent test failure for TestResourceLocalizationService
|
YARN-4393. Fix intermittent test failure for TestResourceLocalizationService
|
||||||
#testFailedDirsResourceRelease (Varun Saxana via rohithsharmaks)
|
#testFailedDirsResourceRelease (Varun Saxana via rohithsharmaks)
|
||||||
|
|
||||||
|
YARN-5353. ResourceManager can leak delegation tokens when they are shared across
|
||||||
|
apps. (Jason Lowe via Varun Saxena)
|
||||||
|
|
||||||
Release 2.7.3 - UNRELEASED
|
Release 2.7.3 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -738,7 +738,7 @@ public class DelegationTokenRenewer extends AbstractService {
|
||||||
|
|
||||||
private void removeApplicationFromRenewal(ApplicationId applicationId) {
|
private void removeApplicationFromRenewal(ApplicationId applicationId) {
|
||||||
rmContext.getSystemCredentialsForApps().remove(applicationId);
|
rmContext.getSystemCredentialsForApps().remove(applicationId);
|
||||||
Set<DelegationTokenToRenew> tokens = appTokens.get(applicationId);
|
Set<DelegationTokenToRenew> tokens = appTokens.remove(applicationId);
|
||||||
|
|
||||||
if (tokens != null && !tokens.isEmpty()) {
|
if (tokens != null && !tokens.isEmpty()) {
|
||||||
synchronized (tokens) {
|
synchronized (tokens) {
|
||||||
|
@ -763,15 +763,10 @@ public class DelegationTokenRenewer extends AbstractService {
|
||||||
// cancel the token
|
// cancel the token
|
||||||
cancelToken(dttr);
|
cancelToken(dttr);
|
||||||
|
|
||||||
it.remove();
|
|
||||||
allTokens.remove(dttr.token);
|
allTokens.remove(dttr.token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tokens != null && tokens.isEmpty()) {
|
|
||||||
appTokens.remove(applicationId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1139,5 +1139,8 @@ public class TestDelegationTokenRenewer {
|
||||||
Assert.assertTrue(dttr.referringAppIds.isEmpty());
|
Assert.assertTrue(dttr.referringAppIds.isEmpty());
|
||||||
Assert.assertTrue(dttr.isTimerCancelled());
|
Assert.assertTrue(dttr.isTimerCancelled());
|
||||||
Assert.assertTrue(Renewer.cancelled);
|
Assert.assertTrue(Renewer.cancelled);
|
||||||
|
|
||||||
|
// make sure the token also has been removed from appTokens
|
||||||
|
Assert.assertFalse(renewer.getDelegationTokens().contains(token1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue