diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 97a6564e702..fb309bad82f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -456,6 +456,8 @@ Release 2.0.1-alpha - UNRELEASED header when offset is specified and length is omitted. (Ravi Prakash via szetszwo) + HDFS-3048. Small race in BlockManager#close. (Andy Isaacson via eli) + BREAKDOWN OF HDFS-3042 SUBTASKS HDFS-2185. HDFS portion of ZK-based FailoverController (todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java index a7e96f48337..4f3e354d86b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java @@ -374,10 +374,17 @@ public class BlockManager { } public void close() { - if (pendingReplications != null) pendingReplications.stop(); - blocksMap.close(); - datanodeManager.close(); - if (replicationThread != null) replicationThread.interrupt(); + try { + if (replicationThread != null) { + replicationThread.interrupt(); + replicationThread.join(3000); + } + } catch (InterruptedException ie) { + } finally { + if (pendingReplications != null) pendingReplications.stop(); + blocksMap.close(); + datanodeManager.close(); + } } /** @return the datanodeManager */