atris commented on a change in pull request #1686:
URL: https://github.com/apache/lucene-solr/pull/1686#discussion_r467176662



##########
File path: solr/core/src/java/org/apache/solr/servlet/RequestRateLimiter.java
##########
@@ -152,14 +143,22 @@ public RateLimiterConfig(SolrRequest.SolrRequestType 
requestType, boolean isEnab
     }
   }
 
-  // Represents the metadata for an acquired slot
-  static class AcquiredSlotMetadata {
-    public RequestRateLimiter requestRateLimiter;
-    public Semaphore usedPool;
+  // Represents the metadata for a slot
+  static class SlotMetadata {
+    private Semaphore usedPool;
 
-    public AcquiredSlotMetadata(RequestRateLimiter requestRateLimiter, 
Semaphore usedPool) {
-      this.requestRateLimiter = requestRateLimiter;
+    public SlotMetadata(Semaphore usedPool) {
       this.usedPool = usedPool;
     }
+
+    public void decrementRequest() {
+      if (usedPool != null) {
+        usedPool.release();
+      }
+    }
+
+    public boolean isUsedPoolNull() {

Review comment:
       We need this to avoid caching a request when request rate limiter is 
disabled. Renaming the method.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to