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 543278f929e..9952408e6bc 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 @@ -3562,7 +3562,7 @@ public class BlockManager implements BlockStatsMXBean { /* * Stop the ongoing initialisation of reconstruction queues */ - private void stopReconstructionInitializer() { + public void stopReconstructionInitializer() { if (reconstructionQueuesInitializer != null) { reconstructionQueuesInitializer.interrupt(); try { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 7a7d072ec43..1644d6fff46 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -1365,8 +1365,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, LOG.info("Stopping services started for active state"); writeLock(); try { - if (blockManager != null && blockManager.getSPSManager() != null) { - blockManager.getSPSManager().stop(); + if (blockManager != null) { + blockManager.stopReconstructionInitializer(); + if (blockManager.getSPSManager() != null) { + blockManager.getSPSManager().stop(); + } } stopSecretManager(); leaseManager.stopMonitor();