-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
Services like Celery Beat are singletons — only one instance should run at a time. The current deploy roles don't fit well:
app— rolling deploy scales to 2 temporarily, causing duplicate schedulingaccessory— never restarted, so it runs stale code after deploy
Current workaround
Using deploy.role=app with deploy.drain=1 to minimize the overlap window. Tasks are assumed idempotent, so brief duplicate scheduling is tolerable.
Proposal
A third deploy role (e.g. singleton or sequential) that does stop-before-start instead of rolling:
- Send SIGTERM to the old container, wait for graceful shutdown
- Start the new container
- Health check the new container
This would be useful for any service where exactly-one-at-a-time semantics matter: beat schedulers, cron runners, lock holders, single-consumer queues.
Alternatives considered
- celery-redbeat: Distributed lock scheduler that makes beat safe for rolling deploys. Works but adds a dependency to solve a deploy-tool gap.
- deploy.drain=1: Minimizes overlap but doesn't eliminate it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels