|
@@ -200,11 +200,16 @@ public class DelegationTokenRenewal {
|
|
*/
|
|
*/
|
|
private static class RenewalTimerTask extends TimerTask {
|
|
private static class RenewalTimerTask extends TimerTask {
|
|
private DelegationTokenToRenew dttr;
|
|
private DelegationTokenToRenew dttr;
|
|
|
|
+ private boolean cancelled = false;
|
|
|
|
|
|
RenewalTimerTask(DelegationTokenToRenew t) { dttr = t; }
|
|
RenewalTimerTask(DelegationTokenToRenew t) { dttr = t; }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void run() {
|
|
|
|
|
|
+ public synchronized void run() {
|
|
|
|
+ if (cancelled) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
Token<?> token = dttr.token;
|
|
Token<?> token = dttr.token;
|
|
try {
|
|
try {
|
|
// need to use doAs so that http can find the kerberos tgt
|
|
// need to use doAs so that http can find the kerberos tgt
|
|
@@ -227,6 +232,12 @@ public class DelegationTokenRenewal {
|
|
removeFailedDelegationToken(dttr);
|
|
removeFailedDelegationToken(dttr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public synchronized boolean cancel() {
|
|
|
|
+ cancelled = true;
|
|
|
|
+ return super.cancel();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|