YARN-3472. Fixed possible leak in DelegationTokenRenewer#allTokens. Contributed by Rohith Sharmaks
This commit is contained in:
parent
5cda6fffd3
commit
a1afbc48b5
@ -180,6 +180,9 @@ Release 2.8.0 - UNRELEASED
|
|||||||
YARN-3382. Some of UserMetricsInfo metrics are incorrectly set to root
|
YARN-3382. Some of UserMetricsInfo metrics are incorrectly set to root
|
||||||
queue metrics. (Rohit Agarwal via jianhe)
|
queue metrics. (Rohit Agarwal via jianhe)
|
||||||
|
|
||||||
|
YARN-3472. Fixed possible leak in DelegationTokenRenewer#allTokens.
|
||||||
|
(Rohith Sharmaks via jianhe)
|
||||||
|
|
||||||
Release 2.7.1 - UNRELEASED
|
Release 2.7.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -577,6 +577,7 @@ private void requestNewHdfsDelegationTokenIfNeeded(
|
|||||||
DelegationTokenToRenew t = iter.next();
|
DelegationTokenToRenew t = iter.next();
|
||||||
if (t.token.getKind().equals(new Text("HDFS_DELEGATION_TOKEN"))) {
|
if (t.token.getKind().equals(new Text("HDFS_DELEGATION_TOKEN"))) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
|
allTokens.remove(t.token);
|
||||||
t.cancelTimer();
|
t.cancelTimer();
|
||||||
LOG.info("Removed expiring token " + t);
|
LOG.info("Removed expiring token " + t);
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,16 @@ protected Token<?>[] obtainSystemTokensForUser(String user,
|
|||||||
new HashMap<ApplicationAccessType, String>(), false, "default", 1,
|
new HashMap<ApplicationAccessType, String>(), false, "default", 1,
|
||||||
credentials);
|
credentials);
|
||||||
|
|
||||||
// wait for the initial expiring hdfs token to be removed.
|
// wait for the initial expiring hdfs token to be removed from allTokens
|
||||||
|
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
||||||
|
public Boolean get() {
|
||||||
|
return
|
||||||
|
rm.getRMContext().getDelegationTokenRenewer().getAllTokens()
|
||||||
|
.get(token1) == null;
|
||||||
|
}
|
||||||
|
}, 1000, 20000);
|
||||||
|
|
||||||
|
// wait for the initial expiring hdfs token to be removed from appTokens
|
||||||
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
||||||
public Boolean get() {
|
public Boolean get() {
|
||||||
return !rm.getRMContext().getDelegationTokenRenewer()
|
return !rm.getRMContext().getDelegationTokenRenewer()
|
||||||
|
Loading…
Reference in New Issue
Block a user