From 7649cc95251661601c1720d9adf59b64222b147a Mon Sep 17 00:00:00 2001 From: Dongsheng Yang Date: Mon, 11 Jun 2018 22:36:40 -0400 Subject: [PATCH] TokenBucketThrottle: Init the remain with max when we want to set_max and the max was 0 Signed-off-by: Dongsheng Yang --- src/common/Throttle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 1e9aed5d36ba8..877ace344f1d9 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -685,7 +685,7 @@ uint64_t TokenBucketThrottle::Bucket::put(uint64_t c) { } void TokenBucketThrottle::Bucket::set_max(uint64_t m) { - if (remain > m) + if (remain > m || max == 0) remain = m; max = m; } -- 2.39.5