瀏覽代碼

HADOOP-12191. Bzip2Factory is not thread safe. Contributed by Brahma Reddy Battula.

Tsuyoshi Ozawa 10 年之前
父節點
當前提交
4084eaf943

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -973,6 +973,9 @@ Release 2.7.2 - UNRELEASED
     HADOOP-12186. ActiveStandbyElector shouldn't call monitorLockNodeAsync
     multiple times (zhihai xu via vinayakumarb)
 
+    HADOOP-12191. Bzip2Factory is not thread safe. (Brahma Reddy Battula
+    via ozawa)
+
 Release 2.7.1 - 2015-07-06 
 
   INCOMPATIBLE CHANGES

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java

@@ -44,7 +44,7 @@ public class Bzip2Factory {
    * @return <code>true</code> if native-bzip2 is loaded & initialized 
    *         and can be loaded for this job, else <code>false</code>
    */
-  public static boolean isNativeBzip2Loaded(Configuration conf) {
+  public static synchronized boolean isNativeBzip2Loaded(Configuration conf) {
     String libname = conf.get("io.compression.codec.bzip2.library", 
                               "system-native");
     if (!bzip2LibraryName.equals(libname)) {