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 explore the backup scheduling code and the
IsExecutinginterface to implement the preemption fix. - Assistant
Implementing
IsExecuting()and updating backup scheduling so pending backups can't preempt executing ones. - Assistant
Updating tests to cover the new behavior:
- Assistant
Fixed backup scheduling so pending backups no longer preempt an already-executing backup.
Root cause
CanExecuteBackupusedIsInProgress(), which treatspendingthe same asstarted/running. A pending backup that sorted first alphabetically could block or displace a backup that was actually executing.Changes in
api/v1/backup_funcs.go-
IsExecuting()— returnstrueonly forstartedorrunningphases (backups holding active resources). -
IsPending()— returnstruefor empty phase orpendingphase (backups waiting to start). -
GetPendingBackupNames()— now:- Collects only truly pending backups (via
IsPending()) - Sorts by creation time (oldest first)
- Uses backup name as a deterministic tie-breaker
- Collects only truly pending backups (via
-
— now:
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.