Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#1448 Make swamp serve durable and highly available

Opened by stack72 · 7/28/2026

Problem

swamp serve is a single point of failure. Every piece of in-flight state — queued webhook runs, queued cron fires, active workflow executions, and worker dispatch bookkeeping — lives in memory. A process crash silently loses accepted work that callers already received a 200 queued for. On restart, a boot sweep tombstones interrupted workflows rather than recovering them. Running a second instance is actively destructive: the new instance's startup sweep destroys the first instance's live state.

This makes swamp serve unsuitable for any deployment where uptime matters — Kubernetes pods get replaced, ASG instances die, processes OOM, and hosts reboot. Today, every one of those events loses work with no recourse.

Desired Outcome

swamp serve can be deployed as one or more instances behind a load balancer with no accepted work lost on process death, no unsafe overlap during instance replacement, and no new infrastructure dependencies.

Specifically:

  • No accepted work is ever memory-only. Every webhook acknowledgement and cron fire is backed by a durable record before the caller is told it succeeded.
  • Process death is recoverable. Interrupted work is re-enqueued or resumed at startup according to a per-workflow policy, not silently discarded.
  • Instance replacement is safe. A new instance starting while an old one is still running cannot corrupt or destroy the old instance's in-flight state.
  • Multiple instances can share work. N instances can run against the same datastore, dividing work by per-item claims, with distributed deduplication for cron.
  • No new services. All coordination primitives (leases, epochs, claims, fire records) are records in the datastore the repo already has. The deployment unit remains a single swamp binary.

The full design brief and phase breakdown live in the artifact linked from this session. The implementation will be tracked as child issues of this one.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

7/29/2026, 3:58:22 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

stack72 commented 7/28/2026, 11:23:32 PM

First PR - https://github.com/swamp-club/swamp/pull/2005

swamp serve ties a run's life to the WebSocket that started it. Socket dies, run dies. That makes HA impossible — there's nothing to reconnect to.

This PR adds --detach-runs. With it, runs execute independently of the client connection. A disconnected client can re-attach by run ID and pick up the event stream where it left off. Without the flag, behavior is identical to today.

this is the foundation for durable jobs, crash recovery and multi-instance so clients can reconnect

Sign in to post a ripple.