Details
Description
MiniZooKeeperCluster#startup() starts servers one-by-one, if everything is good, it would declare success of start:
public int startup(File baseDir, int numZooKeeperServers) ... // running all the ZK servers for (int i = 0; i < numZooKeeperServers; i++) { ...===> could throw exception in the loop and end the startup // Start up this ZK server standaloneServerFactory.startup(server); ... standaloneServerFactoryList.add(standaloneServerFactory); zooKeeperServers.add(server); } ... started = true; ... }
However, if exception throws in the middle of start up (eg. some servers already started), the MiniZooKeeperCluster#shutdown() would not shut down them and clean up resources.
public void shutdown() throws IOException { if (!started) { return; } ... }