HDFS-15448. Remove duplicate BlockPoolManager starting when run DataNode. Contriubted by jianghua zhu.

This commit is contained in:
He Xiaoqiao 2020-08-24 21:13:47 +08:00
parent 960fb0aa4f
commit a7830423c5
2 changed files with 16 additions and 1 deletions

View File

@ -2710,7 +2710,11 @@ public class DataNode extends ReconfigurableBase
* If this thread is specifically interrupted, it will stop waiting.
*/
public void runDatanodeDaemon() throws IOException {
blockPoolManager.startAll();
// Verify that blockPoolManager has been started.
if (!isDatanodeUp()) {
throw new IOException("Failed to instantiate DataNode.");
}
// start dataXceiveServer
dataXceiverServer.start();

View File

@ -82,6 +82,17 @@ public class TestDataNodeExit {
dn.getBpOsCount());
}
@Test
public void testBPServiceState() {
List<DataNode> dataNodes = cluster.getDataNodes();
for (DataNode dataNode : dataNodes) {
List<BPOfferService> bposList = dataNode.getAllBpOs();
for (BPOfferService bpOfferService : bposList) {
assertTrue(bpOfferService.isAlive());
}
}
}
/**
* Test BPService Thread Exit
*/