|
@@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.server.resourcemanager.security;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.nio.ByteBuffer;
|
|
|
-import java.security.PrivilegedAction;
|
|
|
import java.security.PrivilegedExceptionAction;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
@@ -39,6 +38,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|
|
import java.util.concurrent.ThreadFactory;
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.concurrent.locks.ReadWriteLock;
|
|
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
|
|
|
@@ -445,15 +445,15 @@ public class DelegationTokenRenewer extends AbstractService {
|
|
|
*/
|
|
|
private class RenewalTimerTask extends TimerTask {
|
|
|
private DelegationTokenToRenew dttr;
|
|
|
- private boolean cancelled = false;
|
|
|
+ private AtomicBoolean cancelled = new AtomicBoolean(false);
|
|
|
|
|
|
RenewalTimerTask(DelegationTokenToRenew t) {
|
|
|
dttr = t;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public synchronized void run() {
|
|
|
- if (cancelled) {
|
|
|
+ public void run() {
|
|
|
+ if (cancelled.get()) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -475,8 +475,8 @@ public class DelegationTokenRenewer extends AbstractService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public synchronized boolean cancel() {
|
|
|
- cancelled = true;
|
|
|
+ public boolean cancel() {
|
|
|
+ cancelled.set(true);
|
|
|
return super.cancel();
|
|
|
}
|
|
|
}
|