HADOOP-11499. Check of executorThreadsStarted in ValueQueue#submitRefillTask() evades lock acquisition. Contributed by Ted Yu

(cherry picked from commit 7574df1bba)
This commit is contained in:
Jason Lowe 2015-01-26 16:56:14 +00:00
parent 2cf58ca5a6
commit a389056afa
2 changed files with 10 additions and 5 deletions

View File

@ -408,6 +408,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11482. Use correct UGI when KMSClientProvider is called by a proxy HADOOP-11482. Use correct UGI when KMSClientProvider is called by a proxy
user. Contributed by Arun Suresh. user. Contributed by Arun Suresh.
HADOOP-11499. Check of executorThreadsStarted in
ValueQueue#submitRefillTask() evades lock acquisition (Ted Yu via jlowe)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -308,11 +308,13 @@ public class ValueQueue <E> {
final Queue<E> keyQueue) throws InterruptedException { final Queue<E> keyQueue) throws InterruptedException {
if (!executorThreadsStarted) { if (!executorThreadsStarted) {
synchronized (this) { synchronized (this) {
// To ensure all requests are first queued, make coreThreads = if (!executorThreadsStarted) {
// maxThreads // To ensure all requests are first queued, make coreThreads =
// and pre-start all the Core Threads. // maxThreads
executor.prestartAllCoreThreads(); // and pre-start all the Core Threads.
executorThreadsStarted = true; executor.prestartAllCoreThreads();
executorThreadsStarted = true;
}
} }
} }
// The submit/execute method of the ThreadPoolExecutor is bypassed and // The submit/execute method of the ThreadPoolExecutor is bypassed and