Skip to content
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
12 changes: 9 additions & 3 deletions plugins/gc/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,15 @@ func (s *gcScheduler) run(ctx context.Context) {
if err != nil {
log.G(ctx).WithError(err).Error("garbage collection failed")
collectionCounter.WithValues("fail").Inc()

// Reschedule garbage collection for same duration + 1 second
schedC, nextCollection = schedule(nextCollection.Sub(*lastCollection) + time.Second)
var retryDelay time.Duration
if lastCollection != nil {
// If we have a previous collection time, reschedule based on that interval.
retryDelay = nextCollection.Sub(*lastCollection) + time.Second
} else {
// If this is the first collection and it failed, use the default schedule delay.
retryDelay = s.scheduleDelay
}
schedC, nextCollection = schedule(retryDelay)

// Update last collection time even though failure occurred
lastCollection = &last
Expand Down
Loading