Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7498c142
Commit
7498c142
authored
Jan 07, 2019
by
Krzysztof Jastrzebski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comments in Horizontal Pod Autoscaler Controller.
parent
1641ff41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
horizontal.go
pkg/controller/podautoscaler/horizontal.go
+12
-5
No files found.
pkg/controller/podautoscaler/horizontal.go
View file @
7498c142
...
...
@@ -179,7 +179,9 @@ func (a *HorizontalController) enqueueHPA(obj interface{}) {
return
}
// always add rate-limited so we don't fetch metrics more that once per resync interval
// Requests are always added to queue with resyncPeriod delay. If there's already
// request for the HPA in the queue then a new request is always dropped. Requests spend resync
// interval in queue so HPAs are processed every resync interval.
a
.
queue
.
AddRateLimited
(
key
)
}
...
...
@@ -211,10 +213,15 @@ func (a *HorizontalController) processNextWorkItem() bool {
if
err
!=
nil
{
utilruntime
.
HandleError
(
err
)
}
// Add request processing HPA after resync interval just in case last resync didn't insert
// request into the queue. Request is not inserted into queue by resync if previous one wasn't processed yet.
// This happens quite often because requests from previous resync are removed from the queue at the same moment
// as next resync inserts new requests.
// Add request processing HPA to queue with resyncPeriod delay.
// Requests are always added to queue with resyncPeriod delay. If there's already request
// for the HPA in the queue then a new request is always dropped. Requests spend resyncPeriod
// in queue so HPAs are processed every resyncPeriod.
// Request is added here just in case last resync didn't insert request into the queue. This
// happens quite often because there is race condition between adding request after resyncPeriod
// and removing them from queue. Request can be added by resync before previous request is
// removed from queue. If we didn't add request here then in this case one request would be dropped
// and HPA would processed after 2 x resyncPeriod.
if
!
deleted
{
a
.
queue
.
AddRateLimited
(
key
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment