aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-apps
diff options
context:
space:
mode:
Diffstat (limited to 'clustercontroller-apps')
-rw-r--r--clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
index ff7cbbf83da..8ec93b99aff 100644
--- a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
+++ b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/ClusterController.java
@@ -100,8 +100,9 @@ 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);
- curator.framework().blockUntilConnected();
+ try (Curator curator = Curator.create(options.zooKeeperServerAddress)) {
+ curator.framework().blockUntilConnected();
+ }
}
}