Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
smalyu opened this issue Nov 28, 2024 · 0 comments
Open

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

smalyu opened this issue Nov 28, 2024 · 0 comments

Comments

@smalyu
Copy link

smalyu commented Nov 28, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant