Rate limit HPA controller to sync period

Since the HPA controller pulls information from an external source that
makes no guarantees about consistency, it's possible for the HPA
to get into an infinite update loop -- if the metrics change with
every query, the HPA controller will run it's normal reconcilation,
post a status update, see that status update itself, fetch new metrics,
and if those metrics are different, post another status update, and
repeat.  This can lead to continuously updating a single HPA.

By rate-limiting each HPA to once per sync interval, we prevent this
from happening.
This commit is contained in:
Solly Ross
2017-03-08 02:02:34 -05:00
parent d5df405bb1
commit 8337031bf5
4 changed files with 145 additions and 20 deletions

View File

@@ -490,7 +490,7 @@ func (tc *testCase) runTest(t *testing.T) {
)
eventClient := &clientfake.Clientset{}
eventClient.AddReactor("*", "events", func(action core.Action) (handled bool, ret runtime.Object, err error) {
eventClient.AddReactor("create", "events", func(action core.Action) (handled bool, ret runtime.Object, err error) {
tc.Lock()
defer tc.Unlock()