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

DatabaseScheduler does not drop beat_schedule-equivalent PeriodicTasks that were removed from the beat_schedule dict #654

Open
sanchit-mathew opened this issue May 12, 2023 · 2 comments

Comments

@sanchit-mathew
Copy link

sanchit-mathew commented May 12, 2023

Summary:

The DatabaseScheduler picks up tasks from the beat schedule and creates or updates corresponding PeriodicTask entries on the scheduler's setup but doesn't drop the PeriodicTask entry if the beat schedule entry corresponding to that task is dropped

  • Celery Version: 5.2.3
  • Celery-Beat Version: 2.4.0

Exact steps to reproduce the issue:

  1. Have a CELERYBEAT_SCHEDULE setup in your Django settings with a couple of tasks
  2. Start the Celery Beat service with the scheduler as DatabaseScheduler. There will be PeriodicTask entries created in the DB, corresponding to the CELERYBEAT_SCHEDULE tasks
  3. Stop the Celery Beat service and remove one or more tasks from the CELERYBEAT_SCHEDULE setting
  4. Restart the Celery Beat service with the DatabaseScheduler scheduler. The PeriodicTask entries corresponding to the CELERYBEAT_SCHEDULE tasks still exist and remain enabled

Detailed information

for name, entry_fields in mapping.items():

  • At this line, we use the default beat_schedule and create/update PeriodicTask entries corresponding to the same but if there are any tasks dropped in the beat_schedule, the PeriodicTask entries corresponding to the same are not deleted/disabled accordingly
@ento
Copy link

ento commented Jul 22, 2023

Sounds like the same issue as

@m-r-k-f
Copy link

m-r-k-f commented Jul 10, 2024

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

3 participants