Pending backups can preempt a backup that is already executing Backup scheduling must…
- User
Pending backups can preempt a backup that is already executing
Backup scheduling must not select a pending backup while another backup is already executing. When none is executing, select the oldest pending backup, using a deterministic tie-break for equal creation times.
Interface
Type: Function Name: IsExecuting Path: api/v1/backup_funcs.go Input: () Output: bool Description: Returns true if the backup has started or is running. Use this to determine whether a backup holds active resources and should not be preempted.
- Assistant
I'll locate the backup scheduling logic and the
IsExecutinghook so we can prevent pending backups from preempting an active run. - Assistant
Checking how pending backups are set and whether there are related tests or recent changes:
- Assistant
Implementing
IsExecutingand updating scheduling so pending backups can't preempt active runs; selecting the oldest pending backup when none are executing. - Assistant
Adding tests for the new behavior:
- Assistant
Fixed the backup scheduling bug where a pending backup could preempt one already executing.
Root cause
CanExecuteBackuptreatedBackupPhasePendingas "in progress" viaIsInProgress(), so a pending backup was allowed to run even when another backup was already executing.Changes
api/v1/backup_funcs.go-
IsExecuting()— returnstrueonly forstartedorrunningphases (backups that hold active resources). -
GetPendingBackupNames()— collects backups that are not done and not executing (including explicitpendingphase). Sorts by creation time (oldest first), with name as a deterministic tie-breaker. -
CanExecuteBackup()— usesIsExecuting()instead ofIsInProgress():- If any backup is executing, only that backup may run.
- Otherwise, only the oldest pending backup may run.
api/v1/backup_funcs_test.go— added tests forIsExecuting, creation-time ordering, name tie-breaking, and the pending-vs-running preemption case.All 229
api/v1tests and 348 controller tests pass. -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →