feat: backup queue system for concurrent backup conflicts #198

Open
opened 2026-06-30 18:51:08 +00:00 by jmiller · 1 comment
Owner

Summary

When a backup is triggered while another is already running for the same profile, the preflight check currently blocks with an error. Users have no option but to wait or manually cancel the stalled backup. We need a queue system so backups can wait their turn instead of failing.

Requirements

Profile-level conflict behavior setting

Add a new field to the backup profile: Queue Behavior (queue_behavior) with options:

  • Cancel (default, current behavior) — fail immediately if another backup is running
  • Queue — hold the backup in a pending queue and start it automatically when the running backup finishes

Queue mechanics

  • New pending or queued status in the records table
  • When a backup is triggered and another is running:
    • If queue_behavior = 'cancel': current behavior (preflight error)
    • If queue_behavior = 'queue': create the record with queued status, return a message like "Backup queued — will start when the current backup completes"
  • When a backup completes (or is cancelled/fails), check for queued records for the same profile and start the next one
  • Queue should be FIFO — oldest queued backup runs first
  • Queued backups should be visible in the Backup Records list with a "queued" badge
  • Users should be able to cancel queued backups before they start

Applies to all backup triggers

  • Stepped AJAX backups (browser UI)
  • CLI backups (mokosuitebackup:run)
  • Scheduled task backups
  • Pre-update/pre-uninstall system plugin backups

Dashboard/UI

  • Queued backups should show in the backup list with a distinct badge (e.g., badge bg-warning with "queued")
  • Dashboard should show queued count if any are pending
  • The stepped backup modal should show "Backup queued..." status instead of an error when queueing

Notes

  • The 30-minute auto-timeout failsafe (PR #197) should also process queued backups — when a stalled backup is auto-cancelled, the next queued backup should start
  • Consider a max queue depth per profile to prevent runaway queue buildup (e.g., max 3 queued)
## Summary When a backup is triggered while another is already running for the same profile, the preflight check currently blocks with an error. Users have no option but to wait or manually cancel the stalled backup. We need a queue system so backups can wait their turn instead of failing. ## Requirements ### Profile-level conflict behavior setting Add a new field to the backup profile: **Queue Behavior** (`queue_behavior`) with options: - **Cancel** (default, current behavior) — fail immediately if another backup is running - **Queue** — hold the backup in a pending queue and start it automatically when the running backup finishes ### Queue mechanics - New `pending` or `queued` status in the records table - When a backup is triggered and another is running: - If `queue_behavior = 'cancel'`: current behavior (preflight error) - If `queue_behavior = 'queue'`: create the record with `queued` status, return a message like "Backup queued — will start when the current backup completes" - When a backup completes (or is cancelled/fails), check for queued records for the same profile and start the next one - Queue should be FIFO — oldest queued backup runs first - Queued backups should be visible in the Backup Records list with a "queued" badge - Users should be able to cancel queued backups before they start ### Applies to all backup triggers - Stepped AJAX backups (browser UI) - CLI backups (`mokosuitebackup:run`) - Scheduled task backups - Pre-update/pre-uninstall system plugin backups ### Dashboard/UI - Queued backups should show in the backup list with a distinct badge (e.g., `badge bg-warning` with "queued") - Dashboard should show queued count if any are pending - The stepped backup modal should show "Backup queued..." status instead of an error when queueing ## Notes - The 30-minute auto-timeout failsafe (PR #197) should also process queued backups — when a stalled backup is auto-cancelled, the next queued backup should start - Consider a max queue depth per profile to prevent runaway queue buildup (e.g., max 3 queued)
Author
Owner

Branch created: feature/198-feat-backup-queue-system-for-concurrent-

git fetch origin
git checkout feature/198-feat-backup-queue-system-for-concurrent-
Branch created: [`feature/198-feat-backup-queue-system-for-concurrent-`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteBackup/src/branch/feature/198-feat-backup-queue-system-for-concurrent-) ```bash git fetch origin git checkout feature/198-feat-backup-queue-system-for-concurrent- ```
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteBackup#198