From d09c80074ad4f35afc3e710fee8a603e1d39ff52 Mon Sep 17 00:00:00 2001 From: Albert Louis Rossi Date: Mon, 14 Aug 2023 08:30:35 -0500 Subject: [PATCH] dcache-bulk: remove in memory running state counts Motivation: see https://rb.dcache.org/r/13994/ master@4525fc12e1adcb72f44a642b9bbfbdcd4b20a8bc Changes were recently made to hold statistical counts of requests and targets in memory for the sake of efficiency. However, running target counts are still problematic. This is especially true if a request is cancelled. Modification: Rather than trying to rectify what is essentially a transactional problem, the elimination of this count in the `info` display is an easier solution (given its limited usefulness anyway). It should be noted that while the database remains a modest size, calling `target ls -count -state` usually returns relatively quickly and will give a more accurate indication of target state, since it is based on database group-by query. Result: The `running` count, which can be confusing and inaccurate, is not longer displayed. Target: master Request: 9.1 Request: 9.0 Requires-notes: yes Patch: https://rb.dcache.org/r/14052/ Acked-by: Tigran --- .../dcache/services/bulk/util/BulkServiceStatistics.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/util/BulkServiceStatistics.java b/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/util/BulkServiceStatistics.java index 5f38da3b818..715eef7e6eb 100644 --- a/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/util/BulkServiceStatistics.java +++ b/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/util/BulkServiceStatistics.java @@ -95,8 +95,7 @@ public final class BulkServiceStatistics implements CellInfoProvider { private final Map requestTypes = new TreeMap<>(); private final Map userRequests = new TreeMap<>(); private final Map counts - = Map.of(RUNNING.name(), new AtomicLong(0L), - CANCELLED.name(), new AtomicLong(0L), + = Map.of(CANCELLED.name(), new AtomicLong(0L), COMPLETED.name(), new AtomicLong(0L), FAILED.name(), new AtomicLong(0L), SKIPPED.name(), new AtomicLong(0L)); @@ -154,10 +153,6 @@ public void getInfo(PrintWriter pw) { pw.println("---------------- REQUESTS (current) -----------------"); pw.println(String.format(STATS_FORMAT, "Active", activeRequests.get())); pw.println(); - - pw.println("----------------- TARGETS (current) -----------------"); - pw.println(String.format(STATS_FORMAT, RUNNING.name(), counts.get(RUNNING.name()))); - pw.println(); } public String getOwnerCounts() {