YARN-2874. Dead lock in DelegationTokenRenewer which blocks RM to execute any further apps. (Naganarasimha G R via kasha)

(cherry picked from commit 799353e2c7)
This commit is contained in:
Karthik Kambatla 2014-12-03 13:44:41 -08:00
parent 97b3e2b79b
commit 25be97808b
2 changed files with 9 additions and 6 deletions

View File

@ -145,6 +145,9 @@ Release 2.7.0 - UNRELEASED
YARN-2894. Fixed a bug regarding application view acl when RM fails over. YARN-2894. Fixed a bug regarding application view acl when RM fails over.
(Rohith Sharmaks via jianhe) (Rohith Sharmaks via jianhe)
YARN-2874. Dead lock in "DelegationTokenRenewer" which blocks RM to execute
any further apps. (Naganarasimha G R via kasha)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

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