You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pool worker should survive an early spored pool-worker exit (restart-on-exit), not run once at boot #465
Pool workers (#70) run `spored pool-worker` as a one-shot cloud-init/user-data invocation. If that process exits for any reason, the worker instance keeps running (billing) but never pulls another task — it's a silent dead worker until TTL/idle-timeout reaps it.
A real-AWS re-smoke hit exactly this: the worker's `OpenQueue` raced queue creation, got `NonExistentQueue`, and the process exited at boot. That specific race is fixed in #464 (OpenQueue retries the consistency window). But the general fragility remains: any early exit — a transient AWS error the retry doesn't cover, an OOM, a panic, an idle-drain that fires before the submitter has enqueued anything — leaves a dead-but-billing worker.
Proposal
Make the on-instance worker restart-on-exit rather than fire-once:
Run `spored pool-worker` under a small supervisor: either a systemd unit with `Restart=on-failure`/`RestartSec`, or a bash `until` loop in the bootstrap that re-execs it (bounded, with backoff), until the instance's TTL/idle-reaper tears it down.
Care needed so restart-on-exit composes with the intended idle-drain: a clean idle-timeout exit should still let the instance terminate (scale-to-zero), while an error exit should restart. Distinguish via exit code (e.g. 0 = drained-clean → don't restart → let on_complete terminate; non-zero = error → restart).
#464 fixes the observed failure (the consistency race) minimally. This is a broader hardening with a design choice (systemd vs loop, and the drain-vs-error exit-code contract) that deserves its own change + tests, rather than being bundled into a targeted bug fix.
Acceptance
A worker whose `spored pool-worker` exits with an error restarts and resumes pulling.
A worker that idle-drains cleanly still terminates (no busy-restart-loop defeating scale-to-zero).
Covered by a test of the exit-code→restart decision.
Activity
feat(pool): resilient restart-on-error workers (#465) + task-bucket I…
Release v0.97.0