From 4084eaf94347042d9b8cb1e86ba831036621dfdd Mon Sep 17 00:00:00 2001 From: Tsuyoshi Ozawa Date: Tue, 14 Jul 2015 19:13:45 +0900 Subject: [PATCH] HADOOP-12191. Bzip2Factory is not thread safe. Contributed by Brahma Reddy Battula. --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3121430937..a9bd7dea61 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/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 diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java index 32fe910293..45f1edda9a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/bzip2/Bzip2Factory.java @@ -44,7 +44,7 @@ public class Bzip2Factory { * @return true if native-bzip2 is loaded & initialized * and can be loaded for this job, else false */ - 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)) {