summaryrefslogtreecommitdiffstats
path: root/node-admin/src
diff options
context:
space:
mode:
Diffstat (limited to 'node-admin/src')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java
index 7f2d1f1eff7..a7bf22591d4 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/StorageMaintainer.java
@@ -276,8 +276,8 @@ public class StorageMaintainer {
*/
public void handleCoreDumpsForContainer(ContainerName containerName, NodeSpec node, boolean force) {
// Sample number of coredumps on the host
- try {
- numberOfCoredumpsOnHost.sample(Files.list(environment.pathInNodeAdminToDoneCoredumps()).count());
+ try (Stream<Path> files = Files.list(environment.pathInNodeAdminToDoneCoredumps())) {
+ numberOfCoredumpsOnHost.sample(files.count());
} catch (IOException e) {
// Ignore for now - this is either test or a misconfiguration
}