diff --git a/priam/src/main/java/com/netflix/priam/tuner/CassandraTunerService.java b/priam/src/main/java/com/netflix/priam/tuner/CassandraTunerService.java index d04ba7927..ab9e6e611 100644 --- a/priam/src/main/java/com/netflix/priam/tuner/CassandraTunerService.java +++ b/priam/src/main/java/com/netflix/priam/tuner/CassandraTunerService.java @@ -38,9 +38,10 @@ public void updateServicePost() throws Exception { // Update the cassandra to enable/disable new incremental files. new RetryableCallable(6, 10000) { public Void retriableCall() throws Exception { - JMXNodeTool nodetool = JMXNodeTool.instance(configuration); - nodetool.setIncrementalBackupsEnabled( - IncrementalBackup.isEnabled(configuration, backupRestoreConfig)); + try (JMXNodeTool nodeTool = JMXNodeTool.instance(configuration)) { + nodeTool.setIncrementalBackupsEnabled( + IncrementalBackup.isEnabled(configuration, backupRestoreConfig)); + } return null; } }.call();