[java-shib-profile] branch main updated: JSPROF-19 - RelyingParty resolver should stop removing its counters

Codeberg noreply at shibboleth.net
Thu Nov 19 18:05:07 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-shib-profile.

View the commit online:
https://codeberg.org/Shibboleth/java-shib-profile/commit/3f0be25b83d3b01581aa6b2728ca1ca13371b374

The following commit(s) were added to refs/heads/main by this push:
     new 3f0be25  JSPROF-19 - RelyingParty resolver should stop removing its counters
3f0be25 is described below

commit 3f0be25b83d3b01581aa6b2728ca1ca13371b374
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Thu Nov 19 13:02:28 2026 -0500

    JSPROF-19 - RelyingParty resolver should stop removing its counters
    
    https://shibboleth.atlassian.net/browse/JSPROF-19
    
    Removed doDestroy method.
---
 .../DefaultRelyingPartyConfigurationResolver.java   | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
index 3eace6e..048bee1 100644
--- a/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
+++ b/shib-profile-impl/src/main/java/net/shibboleth/profile/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
@@ -106,9 +106,6 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
     
     /** Name for counter map metric. */
     @Nullable private String metricName;
-
-    /** Stored copy of metric for teardown. */
-    @Nullable private Gauge<Map<String,Counter>> counterGauge;
     
     /** Map of override counters. */
     @Nonnull private Map<String,Counter> counterMap;
@@ -235,9 +232,11 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
             counterMap = configIds.stream().collect(
                     CollectionSupport.nonnullCollector(
                             Collectors.toUnmodifiableMap(id -> id, id -> new Counter()))).get();
-            // Note that this gauge must use the support method to register in a synchronized fashion,
-            // and also must store off the instance for later use in destroy.
-            counterGauge = MetricsSupport.register(localMetricName,
+            // Note that this gauge must use the support method to register in a synchronized fashion.
+            // For now this has to replace the existing one if it exists because the counter map is
+            // internal to our instance. Moving that to a static that's synchronized is likely the
+            // future change.
+            MetricsSupport.register(localMetricName,
                     new Gauge<Map<String, Counter>>() {
                         public Map<String, Counter> getValue() {
                             return counterMap;
@@ -246,16 +245,6 @@ public class DefaultRelyingPartyConfigurationResolver extends AbstractIdentifiab
                     true);
         }
     }
-    
-    /** {@inheritDoc} */
-    @Override protected void doDestroy() {
-        final String localMetricName = getMetricName();
-        if (localMetricName != null && counterGauge != null) {
-            MetricsSupport.remove(localMetricName, counterGauge);
-        }
-        
-        super.doDestroy();
-    }
 
     /** {@inheritDoc} */
     @Nonnull public Iterable<RelyingPartyConfiguration> resolve(@Nullable final CriteriaSet criteria)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list