From ee705fa5eefed4e3ba892a0ad19725292e367265 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 3 Dec 2010 22:59:23 +0000 Subject: [PATCH] HADOOP-6939. Inconsistent lock ordering in AbstractDelegationTokenSecretManager. Contributed by Todd Lipcon. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1042047 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ .../AbstractDelegationTokenSecretManager.java | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 063e1c511e..04a7ba5aa4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -34,6 +34,9 @@ Trunk (unreleased changes) HADOOP-7045. TestDU fails on systems with local file systems with extended attributes. (eli) + HADOOP-6939. Inconsistent lock ordering in + AbstractDelegationTokenSecretManager. (Todd Lipcon via tomwhite) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java b/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java index fda62bf4ec..7ed13ff067 100644 --- a/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java +++ b/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java @@ -95,11 +95,13 @@ public AbstractDelegationTokenSecretManager(long delegationKeyUpdateInterval, } /** should be called before this object is used */ - public synchronized void startThreads() throws IOException { + public void startThreads() throws IOException { updateCurrentKey(); - running = true; - tokenRemoverThread = new Daemon(new ExpiredTokenRemover()); - tokenRemoverThread.start(); + synchronized (this) { + running = true; + tokenRemoverThread = new Daemon(new ExpiredTokenRemover()); + tokenRemoverThread.start(); + } } /**