diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index c7a8f2e8405..77446a1425d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -582,6 +582,9 @@ Release 2.0.5-beta - UNRELEASED HDFS-4745. TestDataTransferKeepalive#testSlowReader has race condition that causes sporadic failure. (Chris Nauroth via suresh) + HDFS-4768. File handle leak in datanode when a block pool is removed. + (Chris Nauroth via suresh) + Release 2.0.4-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java index cf80c99a58a..f9f8d328b4f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java @@ -267,7 +267,10 @@ public class DataBlockScanner implements Runnable { } public synchronized void removeBlockPool(String blockPoolId) { - blockPoolScannerMap.remove(blockPoolId); + BlockPoolSliceScanner bpss = blockPoolScannerMap.remove(blockPoolId); + if (bpss != null) { + bpss.shutdown(); + } LOG.info("Removed bpid="+blockPoolId+" from blockPoolScannerMap"); }