From dff727ffb29b6e6a9b1801e2b3875a36541d5a3d Mon Sep 17 00:00:00 2001 From: Zbynek Roubalik Date: Wed, 14 Apr 2021 11:21:30 +0200 Subject: [PATCH 1/2] fix timer in scale loop Signed-off-by: Zbynek Roubalik --- pkg/scaling/scale_handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index df542a44c89..19e57275140 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -140,8 +140,9 @@ func (h *scaleHandler) startScaleLoop(ctx context.Context, withTriggers *kedav1a pollingInterval := getPollingInterval(withTriggers) logger.V(1).Info("Watching with pollingInterval", "PollingInterval", pollingInterval) - tmr := time.NewTimer(pollingInterval) for { + tmr := time.NewTimer(pollingInterval) + select { case <-tmr.C: h.checkScalers(ctx, scalableObject, scalingMutex) From 538d58d0f52189db07b712c545af117478549339 Mon Sep 17 00:00:00 2001 From: Zbynek Roubalik Date: Wed, 14 Apr 2021 11:25:35 +0200 Subject: [PATCH 2/2] update changelog Signed-off-by: Zbynek Roubalik --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c41def229b1..13df400998b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ ## Unreleased - Add OpenStack Metrics Scaler ([#1382](https://github.com/kedacore/keda/issues/1382)) -- Fixed goroutine leaks in usage of timers ([#1704](https://github.com/kedacore/keda/pull/1704)) +- Fixed goroutine leaks in usage of timers ([#1704](https://github.com/kedacore/keda/pull/1704) | [#1739](https://github.com/kedacore/keda/pull/1739)) ### New