Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v16] Fix upgrade window periodics #48215

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions lib/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,30 +1254,6 @@ func (a *Server) syncUpgradeWindowStartHour(ctx context.Context) error {
return nil
}

func (a *Server) periodicSyncUpgradeWindowStartHour() {
checkInterval := interval.New(interval.Config{
Duration: time.Minute * 3,
FirstDuration: utils.FullJitter(time.Second * 30),
Jitter: retryutils.NewSeventhJitter(),
})
defer checkInterval.Stop()

for {
select {
case <-checkInterval.Next():
if err := a.syncUpgradeWindowStartHour(a.closeCtx); err != nil {
if a.closeCtx.Err() == nil {
// we run this periodic at a fairly high frequency, so errors are just
// logged but otherwise ignored.
log.Warnf("Failed to sync upgrade window start hour: %v", err)
}
}
case <-a.closeCtx.Done():
return
}
}
}

// periodicIntervalKey is used to uniquely identify the subintervals registered with
// the interval.MultiInterval instance that we use for managing periodics operations.

Expand Down Expand Up @@ -1478,7 +1454,7 @@ func (a *Server) runPeriodicOperations() {
case dynamicLabelsCheckKey:
go a.syncDynamicLabelsAlert(a.closeCtx)
case upgradeWindowCheckKey:
go a.periodicSyncUpgradeWindowStartHour()
go a.syncUpgradeWindowStartHour(a.closeCtx)
case roleCountKey:
go a.tallyRoles(a.closeCtx)
}
Expand Down
Loading