Skip to content

Commit

Permalink
Fix regression brought by using time.NewTimer() in scale loop (#1739)
Browse files Browse the repository at this point in the history
* fix timer in scale loop

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* update changelog

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
zroubalik authored Apr 16, 2021
1 parent 38b5a7f commit 6df54f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

- Add Azure Pipelines Scaler ([#1706](https://github.com/kedacore/keda/pull/1706))
- 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

Expand Down
3 changes: 2 additions & 1 deletion pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6df54f3

Please sign in to comment.