Relationships
#4633 serve: swamp serve reload turns scheduling and the timed services on or off and re-arms their intervals at once
Opened by stack72 · 11/11/2026· Shipped 11/11/2026
Split out of #4604, part of #4439. Everything in serve.yaml except the listener, the auth mode and the datastore should change with swamp serve reload, not a restart.
This issue covers starting, stopping and re-arming serve's timed services on reload. Grants and admins stay in #4604.
Scheduler
schedule and max-concurrent-scheduled-runs are still marked "not applied by reload yet; restart serve to change it" in the setting catalogue (src/serve/serve_settings_reload.ts). Make them reloadable through the validated reload path; a refused serve.yaml changes nothing.
- Turned on by reload:
- Build and start a scheduled execution service the same way startup does: move the setup in the serve action into a factory both call.
- Take the trigger overrides from the reloaded file.
- Wire these through one live reference:
connectionCtx.scheduledExecution, health, the trigger override updater, the shutdown "schedules" drain, replay and bulk cancel. - Start catch-up only where this instance leads scheduled fires.
- Turned off by reload: drain first, so pending runs are kept for replay, then stop the service and clear the reference.
ScheduledExecutionService.stop()is permanent, so turning scheduling back on builds a new instance. - max-concurrent-scheduled-runs: add a setter on
ScheduledExecutionService; the limit is a readonly field today. - Health:
HealthCollectorcopies the scheduler and its enabled flag at startup; it needs to read them live. - Triggers: once a scheduler can start on reload, a triggers change on a serve without one is applied when the reload turns scheduling on.
Known hazards:
- With no scheduler, boot reconciliation deletes pending cron runs. A serve whose scheduler was turned off by reload must not lose them.
configuredCronWorkflowsis computed once at boot.- In team mode a node that loses the lead exits with code 75, so catch-up must start only on the leader.
Timed services
Since #4602 a reload applies the intervals of services that are already running, with two gaps:
- Late re-arm. Reconciliation, the continuation sweep, token GC and group refresh read the new interval only when they next schedule. A lowered interval waits out the timer already set; with group refresh's 4-hour default, that can be 4 hours. Give each a way to re-arm at once, as the datastore and webhook routes pollers do.
- Starting and stopping. An interval that moves to or from 0, or a service that was never built (group refresh off at startup, the webhook routes poller off, token GC or the continuation sweep disabled), is reported as needing a restart. Build, start or stop the service on reload instead, under the same leader rules startup applies (token GC and the sweep start only where this instance leads).
Tests
- Schedule off then on by reload fires a cron trigger again, and pending runs survive.
- A concurrency change applies to the next queued run.
- Team mode: only the leader runs catch-up.
- A lowered group refresh, token GC, sweep or reconciliation interval takes effect without waiting for the old timer.
- A service turned on or off by an interval change starts or stops without a restart.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.