Skip to content

Commit 91d1cac

Browse files
Rakshith-Rmergify[bot]
authored andcommitted
controller: improve error for missed start times in cronjob
The reclaimspacecronjob may miss too many runs due to the following reasons: - low startingDeadlineSeconds - clock skew - (added now) when user has reduced schedule which in turn leads to the new interval being < 100 times of old interval, aka >100 missed runs. This issue only occurs when user changes schedule which drastically reduces interval by more than 100 times. Error message is improved to ask user to delete and recreate cronjob to overcome this issue. Signed-off-by: Rakshith R <[email protected]>
1 parent 870cc4e commit 91d1cac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

controllers/csiaddons/reclaimspacecronjob_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,13 @@ func getNextSchedule(
388388
starts++
389389
if starts > 100 {
390390
// We can't get the most recent times so just return an empty slice
391+
// This may occur due to low startingDeadlineSeconds, clock skew or
392+
// when user has reduced the schedule which in turn
393+
// leads to the new interval being less than 100 times of the old interval.
391394
return time.Time{}, time.Time{},
392395
fmt.Errorf("too many missed start times (> 100). Set or decrease" +
393-
".spec.startingDeadlineSeconds or check clock skew.")
396+
".spec.startingDeadlineSeconds, check clock skew or" +
397+
" delete and recreate reclaimspacecronjob.")
394398
}
395399
}
396400
return lastMissed, sched.Next(now), nil

0 commit comments

Comments
 (0)