Relationships
#4757 swamp serve: an admin "restart" that ends the serve and lets its in-flight runs be continued
Opened by randybias · 11/14/2026
What I want to do
A workflow running on swamp serve sometimes has to restart that same serve. One example is a workflow that
renews the serve's own TLS certificate. Serve reads --cert-file and --key-file only at startup, and
swamp serve reload reports them as needing a new process. The serve runs under a supervisor that brings it back
when it exits (for example systemd with Restart=always), so ending the process is enough to restart it.
What happens today
swamp servehas no stop or restart subcommand, and the admin API has no call for it.- The only way for a step to end its own serve is to send SIGTERM to the serve process. Serve then drains: it
waits up to
--shutdown-drain-timeout(default 30s) for in-flight runs, including the run that asked for the stop, and then aborts them. - So the restart always costs the full drain timeout, because the run that asked is still waiting on itself.
- After the restart, auto-continuation (new in 20261114) only resumes runs recorded as interrupted. The run that asked for the restart needs to go on afterwards, for example to verify the new certificate and roll back if it is wrong. Whether it does depends on how the aborted run is recorded.
- Setting
--shutdown-drain-timeout 0avoids the wait, but it aborts every other in-flight run on every such restart.
What I would like
An admin-only way to restart the serve, available both as a command against a running serve and to a workflow step. It would:
- stop accepting new runs;
- let other in-flight runs drain as SIGTERM does today;
- not wait for the run that asked for the restart. That run, and any run aborted by the drain, would be recorded as interrupted at the step in progress, so the next serve's auto-continuation can resume them under the usual guard rules;
- exit with a status that tells a supervisor to start it again.
Why it matters
Without it, a self-maintaining workflow on serve has to choose between a 30-second stall plus an unclear run state, and splitting itself into two runs (one before the restart, one started at serve startup) to do its checks. With it, the workflow stays one run, with its verify and rollback steps resumed in that same run after the restart.
Versions
swamp 20261114.115103.0-sha.f37e02ff (Linux).
Open
No activity in this phase yet.
Sign in to post a ripple.