mattrpav commented on code in PR #2276:
URL: https://github.com/apache/activemq/pull/2276#discussion_r4483350269


##########
activemq-client/src/main/java/org/apache/activemq/usage/Usage.java:
##########
@@ -276,6 +296,17 @@ protected void setPercentUsage(int value) {
         }
     }
 
+    /**
+     * Silently refresh the cached percentUsage (no listener events, no waiter 
signalling) -
+     * used by the internal recompute sites in waitForSpace(long,int) and 
isFull(int).
+     * Must be called with the usageLock write lock held. Subclasses that 
cache values derived
+     * from percentUsage override this to refresh them in the same critical 
section.
+     */
+    protected void refreshPercentUsage(int value) {
+        percentUsage = value;
+        bounds = PercentBounds.compute(value, limiter.getLimit(), 
percentUsageMinDelta);
+    }

Review Comment:
   That sounds like a good scenario. I'll look at writing some tests for that 
condition specifically, so we can be alerted to any regression.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to