gavinchou commented on code in PR #66940:
URL: https://github.com/apache/doris/pull/66940#discussion_r3811219332


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceRpcRateLimiter.java:
##########
@@ -68,7 +68,20 @@ long acquire(String methodName, int permits) throws 
RpcException {
         // Resilience4j returns negative when the estimated wait exceeds the 
configured timeout.
         // Otherwise the returned wait time is within 
meta_service_rpc_rate_limit_wait_timeout_ms.
         long nanosToWait = 
holder.rateLimiter.reservePermission(permitsToAcquire);
+        boolean dryRun = Config.meta_service_rpc_rate_limit_dry_run;
         if (nanosToWait < 0) {
+            if (dryRun) {
+                if (MetricRepo.isInit && Config.isCloudMode()) {
+                    
CloudMetrics.META_SERVICE_RPC_ALL_RATE_LIMIT_DRY_RUN_REJECTED.increase(1L);
+                    
CloudMetrics.META_SERVICE_RPC_RATE_LIMIT_DRY_RUN_REJECTED.getOrAdd(methodName).increase(1L);

Review Comment:
   the metrics should always be recorded if it is throttled
   the `meta_service_rpc_rate_limit_dry_run` is used to `return 0` instead of 
`throw error` only. 



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/rpc/MetaServiceRpcRateLimiter.java:
##########
@@ -77,6 +90,17 @@ long acquire(String methodName, int permits) throws 
RpcException {
         }
 
         long waitMs = TimeUnit.NANOSECONDS.toMillis(nanosToWait);
+        if (dryRun) {
+            if (MetricRepo.isInit && Config.isCloudMode()) {

Review Comment:
   ditto



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

Reply via email to