c217009425
Even chunked, a single concurrency-1 maintenance lane is fragile — a 30-min DB backup or a multi-chunk library audit holds the slot and delays the quick self-healing recovery sweeps / vacuum (operator-flagged 2026-06-07: long runs must never block quick maintenance). Route the long one-shots — backup.*, admin.* (normalize/re-extract/cascade- delete), library_audit.* — to a new `maintenance_long` queue served by a dedicated worker (concurrency 1), added to docker-compose (+ dev override). The scheduler keeps the quick `maintenance` lane (sweeps, vacuum, cleanup) for itself, so a backup can no longer starve a 5-min vacuum. UI queue list + routing tests updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
21 lines
775 B
Python
21 lines
775 B
Python
"""Queue routing — the long one-shot maintenance tasks run on a dedicated
|
|
`maintenance_long` lane so a 30-min backup or a multi-chunk audit can't starve
|
|
the quick recovery sweeps / vacuum on the concurrency-1 `maintenance` lane
|
|
(operator-flagged 2026-06-07)."""
|
|
from backend.app.celery_app import celery
|
|
|
|
|
|
def test_long_one_shots_route_to_maintenance_long():
|
|
routes = celery.conf.task_routes
|
|
for prefix in (
|
|
"backend.app.tasks.backup.*",
|
|
"backend.app.tasks.admin.*",
|
|
"backend.app.tasks.library_audit.*",
|
|
):
|
|
assert routes[prefix]["queue"] == "maintenance_long"
|
|
|
|
|
|
def test_quick_maintenance_stays_on_maintenance():
|
|
routes = celery.conf.task_routes
|
|
assert routes["backend.app.tasks.maintenance.*"]["queue"] == "maintenance"
|