From e3da59c92305b096d26295706cac73b44207ca24 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 6 Apr 2021 11:01:53 -0700 Subject: [PATCH] fix possible crash in bucket bandwidth monitor (#11986) --- pkg/bucket/bandwidth/monitor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/bucket/bandwidth/monitor.go b/pkg/bucket/bandwidth/monitor.go index 47e287a05..949c5a44f 100644 --- a/pkg/bucket/bandwidth/monitor.go +++ b/pkg/bucket/bandwidth/monitor.go @@ -123,8 +123,12 @@ func (m *Monitor) getReport(selectBucket SelectionFunction) *bandwidth.Report { if !selectBucket(bucket) { continue } + bucketThrottle, ok := m.bucketThrottle[bucket] + if !ok { + continue + } report.BucketStats[bucket] = bandwidth.Details{ - LimitInBytesPerSecond: m.bucketThrottle[bucket].clusterBandwidth, + LimitInBytesPerSecond: bucketThrottle.clusterBandwidth, CurrentBandwidthInBytesPerSecond: bucketMeasurement.getExpMovingAvgBytesPerSecond(), } }