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
world-postgres: crash recovery runs only at startup, so a stranded run waits for a deploy #3993
There is no periodic equivalent, and no documented way to invoke the sweep against an already-running world. So a run stranded by a lost job recovers only when some process boots.
Why this matters
On a rolling-deploy platform, "some process boots" means "someone deploys". In a busy environment that looks self-healing; in production, where releases are occasional, a stranded run waits for the next one.
Meanwhile the run stays running in workflow_runs, so anything reading run status believes work is in progress.
Worth noting separately: the sweep reports itself with console.log ("Re-enqueued N active run(s) on startup"). With an OpenTelemetry setup that instruments a logger rather than the console, there is no signal that recovery ran or what it found.
Evidence
A run interrupted by a deploy at 09:53 made no progress for 31 minutes. It resumed within 30 seconds of an unrelated deploy at 10:25, whose boot sweep minted a fresh job. Nothing in between would have recovered it.
What we would like
A periodic recovery pass, or a documented supported way to run the sweep from application code so we can schedule it ourselves.
reenqueueActiveRuns is importable from @workflow/world today, but calling it against a live world is not a documented contract, and it re-enqueues every pending/running run indiscriminately — which is right at boot and too blunt on a timer, since a run that is legitimately mid-step would be re-enqueued alongside the stranded ones.
Related: #3992 (attempts are consumed by lost workers rather than failures, which is what strands the run in the first place) and #3994 (the retry cap is not configurable).
Amending the ask, having found #3758 after filing this.
#3758 reports the opposite hazard in the same code: "startup recovery re-enqueues runs a LIVE peer process is executing — concurrent replay corrupts the event log." So reenqueueActiveRuns is already too aggressive at boot, and a periodic version as requested above would make that worse, not better — it would re-enqueue every pending/running run on a timer, including ones a healthy peer is mid-step on.
So please read the request as: a way to recover a stranded run that is safe against a live peer — fencing, a lease, or a liveness check — rather than "run the existing sweep more often". If #3758's fencing lands, a periodic pass becomes reasonable on top of it; without it, more frequent recovery is a corruption risk.
The underlying problem this issue is about is unchanged: a run whose job has been retired has no path back except a process boot, and on a rolling-deploy platform that means waiting for the next deploy.
Activity
zachares commentedon Sep 7, 2026
Amending the ask, having found #3758 after filing this.
#3758 reports the opposite hazard in the same code: "startup recovery re-enqueues runs a LIVE peer process is executing — concurrent replay corrupts the event log." So
reenqueueActiveRunsis already too aggressive at boot, and a periodic version as requested above would make that worse, not better — it would re-enqueue everypending/runningrun on a timer, including ones a healthy peer is mid-step on.So please read the request as: a way to recover a stranded run that is safe against a live peer — fencing, a lease, or a liveness check — rather than "run the existing sweep more often". If #3758's fencing lands, a periodic pass becomes reasonable on top of it; without it, more frequent recovery is a corruption risk.
The underlying problem this issue is about is unchanged: a run whose job has been retired has no path back except a process boot, and on a rolling-deploy platform that means waiting for the next deploy.
[world-postgres] Renew running deliveries' job locks and redeliver ab…