Skip to content

Commit

Permalink
prevent livelock when increasing datastore pool
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 committed Feb 28, 2024
1 parent 748ce0f commit 6ea5075
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,7 @@ func (c *IPAMContext) updateIPPoolIfRequired(ctx context.Context) {
log.Debugf("IP stats - total IPs: %d, assigned IPs: %d, cooldown IPs: %d", stats.TotalIPs, stats.AssignedIPs, stats.CooldownIPs)

if datastorePoolTooLow {
// Allow for rapid scale up to decrease time it takes for pod to retrieve an ip
// but conservative scale down to account for pod churn
for datastorePoolStillTooLow := datastorePoolTooLow; datastorePoolStillTooLow; datastorePoolStillTooLow, _ = c.isDatastorePoolTooLow() {
c.increaseDatastorePool(ctx)
}
c.increaseDatastorePool(ctx)
} else if c.isDatastorePoolTooHigh(stats) {
c.decreaseDatastorePool(decreaseIPPoolInterval)
}
Expand Down

0 comments on commit 6ea5075

Please sign in to comment.