1.40.1 — The scheduler ticks cron
Editorial identity incomplete
2026-10-28
The per-minute cron.d entry that booted a full Django process on every node every minute is gone. Each node's jobs scheduler now ticks the @schedule functions from a daemon thread (JOBS_SCHEDULER_CRON_TICK, default on). The next deploy sweeps the old entry and restarts the scheduler after the API probe passes; cron functions then run as the application account.
Changed
- Every
jobs.py schedulerprocess now runs the@schedulecron functions every minute from a daemon thread: once at start, then at every wall-clock minute boundary, on every node and not only the leadership-lock holder. Fleet-once claims andper_nodekeep the meaning they had under crond.JOBS_SCHEDULER_CRON_TICKcontrols it, default on. - The framework no longer ships the per-minute
cron.d/2_mojo_cronentry. - The deploy's API activation gains two steps after the API probe passes: a sweep of stale project cron files from
/etc/cron.d, then a stop of the running scheduler so the jobs cron starts the ticking replacement. A scheduler that does not stop is a logged warning, not a failed release;aws-checkreports it ascron.heartbeat_missing. check_nodegrades stale cron files by the exact project path followed by/, whitespace or end of line, so a sibling path such as/opt/api2no longer keeps a node in a FAIL no deploy can clear.aws-check'scron.heartbeat_missingremediation names the scheduler instead of an external per-minute shell loop.- A
Schedulerstarted off the main thread no longer crashes installing signal handlers; it runs without them and stops through its stop event.
Fixed
- The deploy's file snapshot matched destinations as substrings, so a recorded
/etc/cron.d/5_reports_v2hid/etc/cron.d/5_reportsfrom being snapshotted. Whole-field match now. - Run as root, post_deploy ignores the
NGINX_ETC,SYSTEMD_ETCandCRON_ETCenvironment overrides and uses the fixed/etcpaths.
Upgrade notes
- The next deploy's API activation removes any regular file in
/etc/cron.dthat names the project path and is not in the renderedaws/cron.d/set, snapshotting it first so rollback puts it back, then restarts the scheduler. On the first adopting deploy the old crond tick covers the minutes the activation takes. A deployment that keeps a project cron file outsideaws/cron.d/loses it: move it intoaws/cron.d/first. - Cron functions now run as the application account, the job engine's user, instead of the web user, and inherit that account's sudoers grants.
JOBS_SCHEDULER_CRON_TICK = Falsewith no external tick means no@schedulefunction runs anywhere. Set it only for a deployment that runs its own tick.- A deploy whose API probe fails sweeps nothing and leaves the old scheduler running, so the old cron entry keeps ticking until a deploy succeeds.