Helios
In developmentDistributed Job Scheduler
A multi-node cron scheduler that elects a single leader over etcd and dispatches jobs through Kafka, guaranteeing that a scheduled job is claimed and executed exactly once — even while nodes crash or get partitioned.
Guarantee at-most-one active leader and exactly-one execution of each scheduled job across nodes that can crash, stall, or lose network connectivity in the middle of a dispatch.
Key decisions
- 01
etcd compare-and-swap leader election
Leadership is claimed with an etcd CAS transaction on a single key backed by a lease. A heartbeat keeps the lease alive, and a node that loses the lease stops dispatching immediately — so there is at most one active leader at any instant.
- 02
Fencing tokens against stale writes
Every leadership epoch carries a monotonically increasing token. Writes stamped with a token older than the last accepted one are rejected before they can reach the data layer, so a demoted or partitioned leader can never corrupt state.
- 03
Kafka dispatch + SKIP LOCKED claiming
The leader publishes due jobs to a Kafka topic; workers consume independently and claim their work with SELECT … FOR UPDATE SKIP LOCKED. Two workers can never lock and execute the same pending job.
- 04
Transactional outbox & dead-letter handling
Job-state changes and their dispatch records are written in a single database transaction to an outbox table, giving atomic DB-then-broker delivery. Jobs stranded after a crash are recovered asynchronously, and tasks stuck in repeated-failure loops are quarantined in a dead-letter queue.
- active leader at any instant
- 1active leader at any instant
- execution per scheduled job
- Onceexecution per scheduled job
- dispatch & outbox poll loop
- 5sdispatch & outbox poll loop
- REST API for jobs & cluster state
- CRUDREST API for jobs & cluster state