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 trace the backup scheduling path and existing tests, then implement the ordering/execution guard and run the focused test suite.
- Assistant
The bug is in
BackupList.CanExecuteBackup: it treats pending as “in progress,” sorts by name, and can therefore let a pending object win over a started/running one. I’m narrowing the expected phase semantics and current unit coverage before changing it. - Assistant
The implementation now separates “executing” (
started/running) from merely pending, prioritizes any executing backup, and otherwise orders eligible backups by creation time plus name. I’ve added regression cases for both preemption and equal-time determinism; I’m running the API tests now. - Assistant
The first test attempt hit the container’s process limit while Go was compiling dependencies, not a code failure. I’m retrying with single-package build parallelism to stay within the environment limit.
- Assistant
The constrained build is still compiling the repository’s large dependency graph and has produced no errors so far. The source is formatted and the diff passes whitespace validation.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.