workflow-runtime 0.0.3: sweep() never recovers a run whose worker died mid-step (fixed on main by #15, unreleased)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Anfängerfreundlichkeit
- 15/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- github, node.js, typescript
Rechercherichtung
This asks for release PR #16 to publish core 0.0.5 and runtime 0.0.4; the fix is already merged in #15 and verified on main. Read #16 for the release status and project release instructions, then check whether the requested versions have shipped to npm. Done means both published packages include the fix so users can pin released versions.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Versions
@tanstack/workflow-core 0.0.4, @tanstack/workflow-runtime 0.0.3 (latest on npm)
Describe the bug and the steps to reproduce it
If the process driving a run dies inside a step, the run stays running with an expired lease forever. In 0.0.3, runtime.sweep() only handles schedules and timers and never calls store.claimStaleRuns. Calling claimStaleRuns plus runWorkflow by hand doesn't help either, because core 0.0.4 has no recover mode, so replay stops at the last checkpoint.
#15 (merged 2026-07-21) fixes this: expired-run recovery in sweep(), recover: true in core, and lease heartbeats. I built main at b928717 and confirmed sweep() re-runs the interrupted step and finishes the run, and that the heartbeat stops a long step from being reclaimed mid-flight.
Request: could the release PR #16 be merged, so core 0.0.5 and runtime 0.0.4 ship to npm? That would let us pin a published version instead of a git SHA.
Your Minimal, Reproducible Example
import { createWorkflow } from '@tanstack/workflow-core'
import { defineWorkflowRuntime, inMemoryWorkflowExecutionStore } from '@tanstack/workflow-runtime'
const wf = createWorkflow({ id: 'wf', version: 'v1' }).handler(async (ctx) => {
await ctx.step('a', async () => 1)
return 'done'
})
const store = inMemoryWorkflowExecutionStore()
const runtime = defineWorkflowRuntime({ store, workflows: { wf: { load: async () => wf } }, defaultLeaseMs: 50 })
await store.createRun({ runId: 'r1', workflowId: 'wf', workflowVersion: 'v1', input: {}, now: Date.now() })
await store.claimRun({ runId: 'r1', leaseOwner: 'dead-worker', leaseMs: 50, now: Date.now() }) // worker dies here
await new Promise((r) => setTimeout(r, 100))
const sweep = await runtime.sweep()
console.log(sweep.summary, (await store.loadRun('r1'))?.status)
// 0.0.3: { scheduled: {}, timers: {}, eventCount: 0 } 'running' (expected: recovered, then finished)
Do you intend to try to help solve this bug with your own PR?
No — the fix is already on main; this is a request to publish it.
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 221
- Forks
- 10
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/workflow
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 52/100
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
-
Dependency DashboardOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
Alle Issues in TanStack/workflow
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Merit-Systems/x402scan#1312 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Native Web
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 80/100
digitalfabrik/integreat-app#4517 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
TLS guide repeats certs/ in the certificate directoryEvtl. vergeben @maheshrijal hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
prometheus/docs#3156 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
medusajs/dtc-starter#90 ·
Maintainer antworten meist innerhalb von 1 Tag