spread-every-schedule-ticks
An every schedule is fanned out to every instance of an app and fired on the epoch-aligned boundary, so all instances woke in the same second and stayed resident together for one idle window (100 instances, every 1h, 15m window: 27 awake on average, 100 at the peak).
Each instance now fires at its own fixed offset into the period: sha256(host) modulo the period, stored in the row's spec text (every 1h offset 1234s) and added by Spec.Next. One instance's fires stay exactly one period apart, and the offset survives restarts, box moves and re-declaring. Spread is the default; carlos schedule set --aligned keeps the boundary. Cron and one-shots are untouched. carlos schedule ls marks each every schedule spread or aligned.
Upgrade: the first converge pass re-arms each old row at its spread time through the existing changed-spec path.
To know before merging:
- Not yet run on a box (the 100-instance, 15m-window check from the spec).
- A hash clumps: 100 hosts over 1h put 33 in the busiest 15 minutes, where even would be 25.
- A box that predates the offset grammar cannot parse the new spec; upgrade the receiving side of a move or HA wake first.
every 24hno longer means midnight UTC; that needs--cronor--aligned.- Tests:
internal/schedule,internal/timerspec,internal/registryand the CLI schedule/golden tests pass. Fullinternal/console,internal/hostand root runs fail in the agent's sandbox withinappropriate ioctl for devicein claim/DB tests; not confirmed against a clean checkout, so CI is the check.
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- james@keymail.dev pushed bb21a0746 ci: rerun the gate
- james@keymail.dev pushed 088efe04e Merge main into spread-every-schedule-ticks (second time)
- james@keymail.dev pushed b3271c9ea Merge main into spread-every-schedule-ticks
- james@keymail.dev pushed 28d693033 census: card and overlay for spread-every-schedule-ticks
- james@keymail.dev pushed 1efd49621 schedule: spread every-ticks across the period, per instance