Also shut down Curator instances created during clustercontroller component setup
@@ -100,9 +100,10 @@ public class ClusterController extends AbstractComponent
*/
private void verifyThatZooKeeperWorks(FleetControllerOptions options) throws Exception {
if (options.zooKeeperServerAddress != null && !"".equals(options.zooKeeperServerAddress)) {
- Curator curator = Curator.create(options.zooKeeperServerAddress);
+ try (Curator curator = Curator.create(options.zooKeeperServerAddress)) {
curator.framework().blockUntilConnected();
}
}
+ }
}
