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

Samer Adra commented on HADOOP-12191:
-------------------------------------

It would perform better if this method only performed the logic the first time 
it was called, and cached the result for all subsequent calls, because whether 
or not the Bzip2 library is available should be the same throughout the 
lifetime of the application -- no need to figure it out every time.
Also, the catch(Throwable) in this method is kind of scary.

> Bzip2Factory is not thread safe
> -------------------------------
>
>                 Key: HADOOP-12191
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12191
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: io
>    Affects Versions: 2.7.1
>            Reporter: Jason Lowe
>            Assignee: Brahma Reddy Battula
>             Fix For: 2.7.2
>
>         Attachments: HADOOP-12191.patch
>
>
> Bzip2Factory.isNativeBzip2Loaded is not protected from multiple threads 
> calling it simultaneously.  A thread can return false from this method 
> despite logging the fact that was going to return true due to manipulations 
> of the static boolean from another thread calling the same method.



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

Reply via email to