zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] jhuan31 commented on a change in pull request #986: ZOOKEEPER-3243: Add server-side request throttling
Date Mon, 01 Jul 2019 18:43:12 GMT
jhuan31 commented on a change in pull request #986: ZOOKEEPER-3243: Add server-side request
throttling
URL: https://github.com/apache/zookeeper/pull/986#discussion_r299170557
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
 ##########
 @@ -735,12 +764,30 @@ public void incInProcess() {
 
     public void decInProcess() {
         requestsInProcess.decrementAndGet();
+        if (requestThrottler != null) {
+            requestThrottler.throttleWake();
+        }
     }
 
     public int getInProcess() {
         return requestsInProcess.get();
     }
 
+    public int getInflight() {
+        if (RequestThrottler.enabled()) {
+            return requestThrottleInflight();
+        } else {
+            return getInProcess();
+        }
+    }
+
+    public int requestThrottleInflight() {
 
 Review comment:
   done

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


With regards,
Apache Git Services

Mime
View raw message