ctubbsii commented on a change in pull request #1965:
URL: https://github.com/apache/accumulo/pull/1965#discussion_r595152659



##########
File path: 
core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
##########
@@ -149,7 +161,7 @@ protected void report() {
     }
 
     @Override
-    public void acquire(long permits) {
+    public synchronized void acquire(long permits) {

Review comment:
       I suspect this warning is because of `+=` effectively being two 
operations on `permitsAcquired`. That warning might possibly be more 
appropriately addressed by making `permitsAcquired` an `AtomicLong` and using 
that type's increment methods. That would probably be better than synchronizing 
on the entire object as this keyword would do.




----------------------------------------------------------------
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.

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


Reply via email to