From e96c88e91400ce510ebf56e327728e8ba1bd0105 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sat, 15 Apr 2023 17:14:26 +0800 Subject: [PATCH] fix: DeleteBucketThrottle must delete ARN (#17034) --- internal/bucket/bandwidth/monitor.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/bucket/bandwidth/monitor.go b/internal/bucket/bandwidth/monitor.go index 3768babe4..abed6bcfa 100644 --- a/internal/bucket/bandwidth/monitor.go +++ b/internal/bucket/bandwidth/monitor.go @@ -186,10 +186,14 @@ func (m *Monitor) DeleteBucket(bucket string) { // DeleteBucketThrottle deletes monitoring for a bucket's target func (m *Monitor) DeleteBucketThrottle(bucket, arn string) { m.tlock.Lock() - delete(m.bucketThrottle, bucket) + if _, ok := m.bucketThrottle[bucket]; ok { + delete(m.bucketThrottle[bucket], arn) + } m.tlock.Unlock() m.mlock.Lock() - delete(m.activeBuckets, bucket) + if _, ok := m.activeBuckets[bucket]; ok { + delete(m.activeBuckets[bucket], arn) + } m.mlock.Unlock() }