You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Workflow archive download stays pending after month lock retries are exhausted #46680
Create a workflow archive download request while another operation holds the archive month lock. Keep the lock busy through the final worker retry, then poll the download status.
Reproduced locally by running the Celery task with its retry count set to five and a month lock that raises WorkflowRunArchiveMonthBusyError.
✔️ Expected Behavior
The download reports a terminal failure when all retries are exhausted, so the user can prepare it again.
❌ Actual Behavior
The Celery task fails but the cached download stays pending. The archive page only polls the status endpoint while pending, and that endpoint does not requeue the task.
The code supports your reproduction: the month lock is acquired before the preparer’s try/except that records FAILED. A busy lock therefore escapes to Celery’s five-retry policy without updating the cached download, and the task has no exhaustion handler to make that state terminal. [1][2]
One detail for a fix: simply calling the existing _mark_failed() on exhaustion would not settle a PENDING download. Its terminal-write helper only saves when the cached status is PROCESSING and both Celery task ID and execution ID match. Exhaustion handling needs to cover the waiting claim while preserving protection against stale deliveries overwriting newer work. [3]
A useful regression would exercise the actual Celery task on its final busy-lock retry, assert cached FAILED with an error and finished_at, then verify a new preparation request creates a fresh claim. The request service already replaces failed claims, whereas get_download() only reads and validates the cached task. [4]
Activity
dosubot commentedon Nov 18, 2026
The code supports your reproduction: the month lock is acquired before the preparer’s
try/exceptthat recordsFAILED. A busy lock therefore escapes to Celery’s five-retry policy without updating the cached download, and the task has no exhaustion handler to make that state terminal. [1] [2]One detail for a fix: simply calling the existing
_mark_failed()on exhaustion would not settle aPENDINGdownload. Its terminal-write helper only saves when the cached status isPROCESSINGand both Celery task ID and execution ID match. Exhaustion handling needs to cover the waiting claim while preserving protection against stale deliveries overwriting newer work. [3]A useful regression would exercise the actual Celery task on its final busy-lock retry, assert cached
FAILEDwith an error andfinished_at, then verify a new preparation request creates a fresh claim. The request service already replaces failed claims, whereasget_download()only reads and validates the cached task. [4]To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.