kezhuw commented on code in PR #2264: URL: https://github.com/apache/zookeeper/pull/2264#discussion_r2120006191
########## zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java: ########## @@ -327,6 +327,9 @@ public synchronized boolean checkLimit(int need) { if (diff > fillTime) { int refill = (int) (diff * fillCount / fillTime); tokens = Math.min(tokens + refill, maxTokens); + if (tokens < 0) { + tokens = maxTokens; + } Review Comment: Anyway, we should not do milliseconds calaculation using `int`. -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org