[ 
https://issues.apache.org/jira/browse/HADOOP-11499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14287589#comment-14287589
 ] 

Jason Lowe commented on HADOOP-11499:
-------------------------------------

Note that calling prestatAllCoreThreads() from multiple threads should be a 
non-issue in practice.  Would still be nice to fix the locking structure in 
case someone later comes along and puts something in the code block that isn't 
thread-safe, but at least for now it shouldn't be causing a problem in the wild.

> Check of executorThreadsStarted in ValueQueue#submitRefillTask() evades lock 
> acquisition
> ----------------------------------------------------------------------------------------
>
>                 Key: HADOOP-11499
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11499
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>     if (!executorThreadsStarted) {
>       synchronized (this) {
>         // To ensure all requests are first queued, make coreThreads =
>         // maxThreads
>         // and pre-start all the Core Threads.
>         executor.prestartAllCoreThreads();
>         executorThreadsStarted = true;
>       }
>     }
> {code}
> It is possible that two threads executing the above code both see 
> executorThreadsStarted as being false, leading to 
> executor.prestartAllCoreThreads() called twice.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to