Skip to content

One-off Tasks Executed Multiple Times After Celery Beat Restart #828

Open
@smalyu

Description

@smalyu

Issue Description

One-off tasks in django-celery-beat are executed multiple times if Celery Beat is restarted shortly after the task runs.


Steps to Reproduce

  1. Create a one-off task (one_off=True) scheduled to run at a specific time.
  2. Start Celery and Celery Beat, wait for the task to execute.
  3. Verify the task has run.
  4. Restart Celery Beat within 10 seconds after the task’s execution.
  5. Observe that the task runs again after the restart.

Expected Behavior

  • One-off tasks should only execute once, even if Celery Beat is restarted shortly after their execution.

Actual Behavior

  • The one-off task is executed again if Celery Beat is restarted within a short time after its initial execution. However, if several minutes pass before restarting, the task does not run again.

Versions

  • celery==5.4.0
  • django-celery-beat==2.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions