You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PR review] prebuilds: backoff never applies to presets whose instance count comes only from a schedule #30057
GetPresetsBackoff limits its build window with rn <= desired_instances, and desired_instances holds the preset's base instances. A preset that sets instances = 0 and gets its count only from scheduling therefore never produces a backoff row, and failing prebuilds are retried on every reconcile cycle regardless of reconciliation_backoff_interval.
coderd/prebuilds/preset_snapshot.go#L423 (needsBackoffPeriod) returns early when there is no backoff row. CalculateDesiredInstances applies the schedule, but only to the create and delete counts.
Steps to reproduce
Push a template whose preset count comes only from a schedule, and whose builds fail:
The query alone shows it: a preset with desired_instances = 0, one template_version_preset_prebuild_schedules row with desired_instances = 2, and one failed prebuild build make GetPresetsBackoff return no rows. The same build on a preset with desired_instances = 1 returns one row.
Expected
After a failure, the preset backs off by reconciliation_backoff_interval per failure, the same as a preset with instances = 2.
Actual
No backoff. On v2.35.7, one such preset produced 156 failed prebuild builds in about 2 hours. The failure hard limit did not stop it either; see #30058.
Version
Seen on v2.35.7. The query is unchanged on main (d40e24cf7d).
changed the title [-]prebuilds: backoff never applies to presets whose instance count comes only from a schedule[/-][+][PR review] prebuilds: backoff never applies to presets whose instance count comes only from a schedule[/+]on Oct 26, 2026
Activity
linear-code commentedon Sep 28, 2026
ENG-3405
[-]prebuilds: backoff never applies to presets whose instance count comes only from a schedule[/-][+][PR review] prebuilds: backoff never applies to presets whose instance count comes only from a schedule[/+]