Skip to content

Workflow archive download stays pending after month lock retries are exhausted #46680

Open

Description

@mikamikasuki

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

main at 7c45669

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

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.

Activity

  1. dosubot commented on Nov 18, 2026

    @dosubot

    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]

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dify with Dosu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions